@nielspeter/eess-ts 0.2.1 → 0.5.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/README.md +61 -35
- package/dist/builders/call-rule-builder.d.ts +66 -26
- package/dist/builders/call-rule-builder.d.ts.map +1 -1
- package/dist/builders/call-rule-builder.js +75 -32
- package/dist/builders/call-rule-builder.js.map +1 -1
- package/dist/builders/class-rule-builder.d.ts +125 -26
- package/dist/builders/class-rule-builder.d.ts.map +1 -1
- package/dist/builders/class-rule-builder.js +141 -55
- package/dist/builders/class-rule-builder.js.map +1 -1
- package/dist/builders/correspondence-builder.d.ts +287 -0
- package/dist/builders/correspondence-builder.d.ts.map +1 -0
- package/dist/builders/correspondence-builder.js +385 -0
- package/dist/builders/correspondence-builder.js.map +1 -0
- package/dist/builders/correspondence-findings.d.ts +104 -0
- package/dist/builders/correspondence-findings.d.ts.map +1 -0
- package/dist/builders/correspondence-findings.js +301 -0
- package/dist/builders/correspondence-findings.js.map +1 -0
- package/dist/builders/cross-layer-builder.d.ts +99 -16
- package/dist/builders/cross-layer-builder.d.ts.map +1 -1
- package/dist/builders/cross-layer-builder.js +182 -35
- package/dist/builders/cross-layer-builder.js.map +1 -1
- package/dist/builders/function-rule-builder.d.ts +144 -25
- package/dist/builders/function-rule-builder.d.ts.map +1 -1
- package/dist/builders/function-rule-builder.js +177 -39
- package/dist/builders/function-rule-builder.js.map +1 -1
- package/dist/builders/jsx-rule-builder.d.ts +70 -14
- package/dist/builders/jsx-rule-builder.d.ts.map +1 -1
- package/dist/builders/jsx-rule-builder.js +73 -14
- package/dist/builders/jsx-rule-builder.js.map +1 -1
- package/dist/builders/module-rule-builder.d.ts +2 -2
- package/dist/builders/module-rule-builder.d.ts.map +1 -1
- package/dist/builders/module-rule-builder.js +16 -19
- package/dist/builders/module-rule-builder.js.map +1 -1
- package/dist/builders/scoped-function-rule-builder.d.ts +11 -0
- package/dist/builders/scoped-function-rule-builder.d.ts.map +1 -1
- package/dist/builders/scoped-function-rule-builder.js +12 -0
- package/dist/builders/scoped-function-rule-builder.js.map +1 -1
- package/dist/builders/slice-discovery-message.d.ts +36 -0
- package/dist/builders/slice-discovery-message.d.ts.map +1 -0
- package/dist/builders/slice-discovery-message.js +181 -0
- package/dist/builders/slice-discovery-message.js.map +1 -0
- package/dist/builders/slice-rule-builder.d.ts +151 -12
- package/dist/builders/slice-rule-builder.d.ts.map +1 -1
- package/dist/builders/slice-rule-builder.js +243 -35
- package/dist/builders/slice-rule-builder.js.map +1 -1
- package/dist/builders/type-rule-builder.d.ts +95 -24
- package/dist/builders/type-rule-builder.d.ts.map +1 -1
- package/dist/builders/type-rule-builder.js +109 -42
- package/dist/builders/type-rule-builder.js.map +1 -1
- package/dist/{helpers → builders}/within.d.ts +2 -2
- package/dist/builders/within.d.ts.map +1 -0
- package/dist/{helpers → builders}/within.js +1 -1
- package/dist/builders/within.js.map +1 -0
- package/dist/cli/commands/baseline.d.ts +8 -3
- package/dist/cli/commands/baseline.d.ts.map +1 -1
- package/dist/cli/commands/baseline.js +111 -7
- package/dist/cli/commands/baseline.js.map +1 -1
- package/dist/cli/commands/check.d.ts +7 -2
- package/dist/cli/commands/check.d.ts.map +1 -1
- package/dist/cli/commands/check.js +385 -47
- package/dist/cli/commands/check.js.map +1 -1
- package/dist/cli/commands/doctor.d.ts +29 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +224 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/explain.d.ts +2 -1
- package/dist/cli/commands/explain.d.ts.map +1 -1
- package/dist/cli/commands/explain.js +19 -10
- package/dist/cli/commands/explain.js.map +1 -1
- package/dist/cli/commands/init.d.ts +9 -3
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +162 -137
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/import-rule-module.d.ts +29 -0
- package/dist/cli/import-rule-module.d.ts.map +1 -0
- package/dist/cli/import-rule-module.js +47 -0
- package/dist/cli/import-rule-module.js.map +1 -0
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +101 -43
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/load-rules.d.ts +6 -11
- package/dist/cli/load-rules.d.ts.map +1 -1
- package/dist/cli/load-rules.js +25 -32
- package/dist/cli/load-rules.js.map +1 -1
- package/dist/cli/resolve-config.d.ts +0 -8
- package/dist/cli/resolve-config.d.ts.map +1 -1
- package/dist/cli/resolve-config.js +25 -55
- package/dist/cli/resolve-config.js.map +1 -1
- package/dist/cli/rule-file-findings.d.ts +178 -0
- package/dist/cli/rule-file-findings.d.ts.map +1 -0
- package/dist/cli/rule-file-findings.js +351 -0
- package/dist/cli/rule-file-findings.js.map +1 -0
- package/dist/cli/watch.d.ts +17 -34
- package/dist/cli/watch.d.ts.map +1 -1
- package/dist/cli/watch.js +14 -129
- package/dist/cli/watch.js.map +1 -1
- package/dist/conditions/body-analysis-function.d.ts.map +1 -1
- package/dist/conditions/body-analysis-function.js +16 -7
- package/dist/conditions/body-analysis-function.js.map +1 -1
- package/dist/conditions/body-analysis-module.d.ts.map +1 -1
- package/dist/conditions/body-analysis-module.js +14 -9
- package/dist/conditions/body-analysis-module.js.map +1 -1
- package/dist/conditions/body-analysis.d.ts.map +1 -1
- package/dist/conditions/body-analysis.js +16 -7
- package/dist/conditions/body-analysis.js.map +1 -1
- package/dist/conditions/call.d.ts.map +1 -1
- package/dist/conditions/call.js +41 -19
- package/dist/conditions/call.js.map +1 -1
- package/dist/conditions/catch-analysis.d.ts +2 -1
- package/dist/conditions/catch-analysis.d.ts.map +1 -1
- package/dist/conditions/catch-analysis.js.map +1 -1
- package/dist/conditions/cross-layer.d.ts +2 -10
- package/dist/conditions/cross-layer.d.ts.map +1 -1
- package/dist/conditions/cross-layer.js +227 -23
- package/dist/conditions/cross-layer.js.map +1 -1
- package/dist/conditions/dependency.d.ts +35 -6
- package/dist/conditions/dependency.d.ts.map +1 -1
- package/dist/conditions/dependency.js +299 -45
- package/dist/conditions/dependency.js.map +1 -1
- package/dist/conditions/exports.d.ts.map +1 -1
- package/dist/conditions/exports.js +41 -37
- package/dist/conditions/exports.js.map +1 -1
- package/dist/conditions/function.d.ts.map +1 -1
- package/dist/conditions/function.js +19 -5
- package/dist/conditions/function.js.map +1 -1
- package/dist/conditions/helpers.d.ts +2 -1
- package/dist/conditions/helpers.d.ts.map +1 -1
- package/dist/conditions/helpers.js +4 -1
- package/dist/conditions/helpers.js.map +1 -1
- package/dist/conditions/jsx.d.ts.map +1 -1
- package/dist/conditions/jsx.js +7 -2
- package/dist/conditions/jsx.js.map +1 -1
- package/dist/conditions/match-identity.d.ts +43 -0
- package/dist/conditions/match-identity.d.ts.map +1 -0
- package/dist/conditions/match-identity.js +43 -0
- package/dist/conditions/match-identity.js.map +1 -0
- package/dist/conditions/members.d.ts.map +1 -1
- package/dist/conditions/members.js +20 -6
- package/dist/conditions/members.js.map +1 -1
- package/dist/conditions/reverse-dependency.d.ts +18 -5
- package/dist/conditions/reverse-dependency.d.ts.map +1 -1
- package/dist/conditions/reverse-dependency.js +155 -93
- package/dist/conditions/reverse-dependency.js.map +1 -1
- package/dist/conditions/slice.d.ts +86 -2
- package/dist/conditions/slice.d.ts.map +1 -1
- package/dist/conditions/slice.js +234 -53
- package/dist/conditions/slice.js.map +1 -1
- package/dist/conditions/structural.d.ts.map +1 -1
- package/dist/conditions/structural.js +16 -4
- package/dist/conditions/structural.js.map +1 -1
- package/dist/core/check-all.d.ts +19 -0
- package/dist/core/check-all.d.ts.map +1 -0
- package/dist/core/check-all.js +150 -0
- package/dist/core/check-all.js.map +1 -0
- package/dist/core/combinators.d.ts +48 -0
- package/dist/core/combinators.d.ts.map +1 -0
- package/dist/core/combinators.js +49 -0
- package/dist/core/combinators.js.map +1 -0
- package/dist/core/descendant-cache.d.ts +36 -0
- package/dist/core/descendant-cache.d.ts.map +1 -0
- package/dist/core/descendant-cache.js +117 -0
- package/dist/core/descendant-cache.js.map +1 -0
- package/dist/core/diagnose.d.ts +234 -0
- package/dist/core/diagnose.d.ts.map +1 -0
- package/dist/core/diagnose.js +390 -0
- package/dist/core/diagnose.js.map +1 -0
- package/dist/core/disk-set.d.ts +48 -0
- package/dist/core/disk-set.d.ts.map +1 -0
- package/dist/core/disk-set.js +218 -0
- package/dist/core/disk-set.js.map +1 -0
- package/dist/core/element-cache.d.ts +75 -0
- package/dist/core/element-cache.d.ts.map +1 -0
- package/dist/core/element-cache.js +32 -0
- package/dist/core/element-cache.js.map +1 -0
- package/dist/core/empty-project-advice.d.ts +75 -0
- package/dist/core/empty-project-advice.d.ts.map +1 -0
- package/dist/core/empty-project-advice.js +61 -0
- package/dist/core/empty-project-advice.js.map +1 -0
- package/dist/core/exclusion-comments.d.ts +19 -0
- package/dist/core/exclusion-comments.d.ts.map +1 -0
- package/dist/core/exclusion-comments.js +7 -0
- package/dist/core/exclusion-comments.js.map +1 -0
- package/dist/core/execute-rule.d.ts +158 -0
- package/dist/core/execute-rule.d.ts.map +1 -0
- package/dist/core/execute-rule.js +666 -0
- package/dist/core/execute-rule.js.map +1 -0
- package/dist/core/glob-diagnosis.d.ts +78 -0
- package/dist/core/glob-diagnosis.d.ts.map +1 -0
- package/dist/core/glob-diagnosis.js +134 -0
- package/dist/core/glob-diagnosis.js.map +1 -0
- package/dist/core/glob-evaluator.d.ts +48 -0
- package/dist/core/glob-evaluator.d.ts.map +1 -0
- package/dist/core/glob-evaluator.js +89 -0
- package/dist/core/glob-evaluator.js.map +1 -0
- package/dist/core/import-candidates.d.ts +60 -0
- package/dist/core/import-candidates.d.ts.map +1 -0
- package/dist/core/import-candidates.js +93 -0
- package/dist/core/import-candidates.js.map +1 -0
- package/dist/core/import-options.d.ts +55 -2
- package/dist/core/import-options.d.ts.map +1 -1
- package/dist/core/import-options.js +64 -0
- package/dist/core/import-options.js.map +1 -1
- package/dist/core/invalidate-on-modify.d.ts +20 -0
- package/dist/core/invalidate-on-modify.d.ts.map +1 -0
- package/dist/core/invalidate-on-modify.js +26 -0
- package/dist/core/invalidate-on-modify.js.map +1 -0
- package/dist/core/line-index.d.ts +3 -0
- package/dist/core/line-index.d.ts.map +1 -0
- package/dist/core/line-index.js +227 -0
- package/dist/core/line-index.js.map +1 -0
- package/dist/core/metric-violation.d.ts +86 -0
- package/dist/core/metric-violation.d.ts.map +1 -0
- package/dist/core/metric-violation.js +132 -0
- package/dist/core/metric-violation.js.map +1 -0
- package/dist/core/module-edges.d.ts +361 -0
- package/dist/core/module-edges.d.ts.map +1 -0
- package/dist/core/module-edges.js +593 -0
- package/dist/core/module-edges.js.map +1 -0
- package/dist/core/object-literal-functions.d.ts +42 -0
- package/dist/core/object-literal-functions.d.ts.map +1 -0
- package/dist/core/object-literal-functions.js +75 -0
- package/dist/core/object-literal-functions.js.map +1 -0
- package/dist/core/orphan-exclusions.d.ts +44 -0
- package/dist/core/orphan-exclusions.d.ts.map +1 -0
- package/dist/core/orphan-exclusions.js +224 -0
- package/dist/core/orphan-exclusions.js.map +1 -0
- package/dist/core/pair-condition.d.ts +32 -3
- package/dist/core/pair-condition.d.ts.map +1 -1
- package/dist/core/path-universe.d.ts +22 -0
- package/dist/core/path-universe.d.ts.map +1 -0
- package/dist/core/path-universe.js +45 -0
- package/dist/core/path-universe.js.map +1 -0
- package/dist/core/per-root-compiler-options.d.ts +20 -0
- package/dist/core/per-root-compiler-options.d.ts.map +1 -0
- package/dist/core/per-root-compiler-options.js +57 -0
- package/dist/core/per-root-compiler-options.js.map +1 -0
- package/dist/core/project-relative.d.ts +98 -0
- package/dist/core/project-relative.d.ts.map +1 -0
- package/dist/core/project-relative.js +185 -0
- package/dist/core/project-relative.js.map +1 -0
- package/dist/core/project.d.ts +7 -1
- package/dist/core/project.d.ts.map +1 -1
- package/dist/core/project.js +29 -4
- package/dist/core/project.js.map +1 -1
- package/dist/core/rule-builder.d.ts +303 -0
- package/dist/core/rule-builder.d.ts.map +1 -0
- package/dist/core/rule-builder.js +463 -0
- package/dist/core/rule-builder.js.map +1 -0
- package/dist/core/rule-declaration.d.ts +32 -0
- package/dist/core/rule-declaration.d.ts.map +1 -0
- package/dist/core/rule-declaration.js +88 -0
- package/dist/core/rule-declaration.js.map +1 -0
- package/dist/core/terminal-builder.d.ts +629 -0
- package/dist/core/terminal-builder.d.ts.map +1 -0
- package/dist/core/terminal-builder.js +807 -0
- package/dist/core/terminal-builder.js.map +1 -0
- package/dist/core/terminal-execution.d.ts +39 -0
- package/dist/core/terminal-execution.d.ts.map +1 -0
- package/dist/core/terminal-execution.js +103 -0
- package/dist/core/terminal-execution.js.map +1 -0
- package/dist/core/ts-comment-mask.d.ts +2 -0
- package/dist/core/ts-comment-mask.d.ts.map +1 -0
- package/dist/core/ts-comment-mask.js +102 -0
- package/dist/core/ts-comment-mask.js.map +1 -0
- package/dist/core/vacuity-diagnosis.d.ts +103 -0
- package/dist/core/vacuity-diagnosis.d.ts.map +1 -0
- package/dist/core/vacuity-diagnosis.js +415 -0
- package/dist/core/vacuity-diagnosis.js.map +1 -0
- package/dist/core/violation.d.ts +16 -11
- package/dist/core/violation.d.ts.map +1 -1
- package/dist/core/violation.js +33 -13
- package/dist/core/violation.js.map +1 -1
- package/dist/graphql/graphql-rule-builder.d.ts +95 -0
- package/dist/graphql/graphql-rule-builder.d.ts.map +1 -0
- package/dist/graphql/graphql-rule-builder.js +127 -0
- package/dist/graphql/graphql-rule-builder.js.map +1 -0
- package/dist/graphql/index.d.ts +1 -0
- package/dist/graphql/index.d.ts.map +1 -1
- package/dist/graphql/index.js +2 -1
- package/dist/graphql/index.js.map +1 -1
- package/dist/graphql/resolver-rule-builder.d.ts +44 -23
- package/dist/graphql/resolver-rule-builder.d.ts.map +1 -1
- package/dist/graphql/resolver-rule-builder.js +80 -72
- package/dist/graphql/resolver-rule-builder.js.map +1 -1
- package/dist/graphql/schema-loader.d.ts +21 -0
- package/dist/graphql/schema-loader.d.ts.map +1 -1
- package/dist/graphql/schema-loader.js +82 -12
- package/dist/graphql/schema-loader.js.map +1 -1
- package/dist/graphql/schema-predicates.d.ts.map +1 -1
- package/dist/graphql/schema-predicates.js +17 -12
- package/dist/graphql/schema-predicates.js.map +1 -1
- package/dist/graphql/schema-rule-builder.d.ts +15 -24
- package/dist/graphql/schema-rule-builder.d.ts.map +1 -1
- package/dist/graphql/schema-rule-builder.js +39 -77
- package/dist/graphql/schema-rule-builder.js.map +1 -1
- package/dist/helpers/baseline-diagnostics.d.ts +45 -0
- package/dist/helpers/baseline-diagnostics.d.ts.map +1 -0
- package/dist/helpers/baseline-diagnostics.js +168 -0
- package/dist/helpers/baseline-diagnostics.js.map +1 -0
- package/dist/helpers/baseline-generator.d.ts +28 -0
- package/dist/helpers/baseline-generator.d.ts.map +1 -0
- package/dist/helpers/baseline-generator.js +27 -0
- package/dist/helpers/baseline-generator.js.map +1 -0
- package/dist/helpers/baseline.d.ts +336 -0
- package/dist/helpers/baseline.d.ts.map +1 -0
- package/dist/helpers/baseline.js +664 -0
- package/dist/helpers/baseline.js.map +1 -0
- package/dist/helpers/body-traversal.d.ts +27 -2
- package/dist/helpers/body-traversal.d.ts.map +1 -1
- package/dist/helpers/body-traversal.js +135 -16
- package/dist/helpers/body-traversal.js.map +1 -1
- package/dist/helpers/callback-extractor.d.ts.map +1 -1
- package/dist/helpers/callback-extractor.js +53 -84
- package/dist/helpers/callback-extractor.js.map +1 -1
- package/dist/helpers/complexity.d.ts +13 -5
- package/dist/helpers/complexity.d.ts.map +1 -1
- package/dist/helpers/complexity.js +15 -6
- package/dist/helpers/complexity.js.map +1 -1
- package/dist/helpers/diff-aware.d.ts +16 -0
- package/dist/helpers/diff-aware.d.ts.map +1 -0
- package/dist/helpers/diff-aware.js +16 -0
- package/dist/helpers/diff-aware.js.map +1 -0
- package/dist/helpers/matchers.d.ts +68 -7
- package/dist/helpers/matchers.d.ts.map +1 -1
- package/dist/helpers/matchers.js +164 -86
- package/dist/helpers/matchers.js.map +1 -1
- package/dist/helpers/slice-graph.d.ts +100 -8
- package/dist/helpers/slice-graph.d.ts.map +1 -1
- package/dist/helpers/slice-graph.js +126 -34
- package/dist/helpers/slice-graph.js.map +1 -1
- package/dist/helpers/tarjan.d.ts +0 -14
- package/dist/helpers/tarjan.d.ts.map +1 -1
- package/dist/helpers/tarjan.js +29 -16
- package/dist/helpers/tarjan.js.map +1 -1
- package/dist/index.d.ts +55 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +67 -15
- package/dist/index.js.map +1 -1
- package/dist/models/arch-call.d.ts +3 -2
- package/dist/models/arch-call.d.ts.map +1 -1
- package/dist/models/arch-call.js.map +1 -1
- package/dist/models/arch-function.d.ts +54 -8
- package/dist/models/arch-function.d.ts.map +1 -1
- package/dist/models/arch-function.js +145 -8
- package/dist/models/arch-function.js.map +1 -1
- package/dist/models/arch-jsx-element.d.ts.map +1 -1
- package/dist/models/arch-jsx-element.js +18 -19
- package/dist/models/arch-jsx-element.js.map +1 -1
- package/dist/models/slice.d.ts +33 -9
- package/dist/models/slice.d.ts.map +1 -1
- package/dist/models/slice.js +129 -19
- package/dist/models/slice.js.map +1 -1
- package/dist/predicates/call.d.ts.map +1 -1
- package/dist/predicates/call.js +5 -0
- package/dist/predicates/call.js.map +1 -1
- package/dist/predicates/identity.d.ts +21 -0
- package/dist/predicates/identity.d.ts.map +1 -1
- package/dist/predicates/identity.js +75 -3
- package/dist/predicates/identity.js.map +1 -1
- package/dist/predicates/index.d.ts +1 -1
- package/dist/predicates/index.d.ts.map +1 -1
- package/dist/predicates/index.js +1 -1
- package/dist/predicates/index.js.map +1 -1
- package/dist/predicates/jsx.d.ts.map +1 -1
- package/dist/predicates/jsx.js +2 -1
- package/dist/predicates/jsx.js.map +1 -1
- package/dist/predicates/metrics.d.ts +4 -2
- package/dist/predicates/metrics.d.ts.map +1 -1
- package/dist/predicates/metrics.js +4 -2
- package/dist/predicates/metrics.js.map +1 -1
- package/dist/predicates/module.d.ts +4 -12
- package/dist/predicates/module.d.ts.map +1 -1
- package/dist/predicates/module.js +57 -37
- package/dist/predicates/module.js.map +1 -1
- package/dist/presets/agent-guardrails.d.ts +49 -16
- package/dist/presets/agent-guardrails.d.ts.map +1 -1
- package/dist/presets/agent-guardrails.js +308 -19
- package/dist/presets/agent-guardrails.js.map +1 -1
- package/dist/presets/boundaries.d.ts +46 -3
- package/dist/presets/boundaries.d.ts.map +1 -1
- package/dist/presets/boundaries.js +132 -23
- package/dist/presets/boundaries.js.map +1 -1
- package/dist/presets/data-layer.d.ts +23 -3
- package/dist/presets/data-layer.d.ts.map +1 -1
- package/dist/presets/data-layer.js +58 -16
- package/dist/presets/data-layer.js.map +1 -1
- package/dist/presets/index.d.ts +10 -5
- package/dist/presets/index.d.ts.map +1 -1
- package/dist/presets/index.js +19 -3
- package/dist/presets/index.js.map +1 -1
- package/dist/presets/layered.d.ts +47 -3
- package/dist/presets/layered.d.ts.map +1 -1
- package/dist/presets/layered.js +66 -29
- package/dist/presets/layered.js.map +1 -1
- package/dist/presets/recommended.d.ts +81 -10
- package/dist/presets/recommended.d.ts.map +1 -1
- package/dist/presets/recommended.js +25 -23
- package/dist/presets/recommended.js.map +1 -1
- package/dist/presets/shared.d.ts +267 -2
- package/dist/presets/shared.d.ts.map +1 -1
- package/dist/presets/shared.js +367 -4
- package/dist/presets/shared.js.map +1 -1
- package/dist/rules/code-quality.d.ts.map +1 -1
- package/dist/rules/code-quality.js +15 -6
- package/dist/rules/code-quality.js.map +1 -1
- package/dist/rules/hygiene.d.ts +1 -1
- package/dist/rules/hygiene.js +1 -1
- package/dist/rules/metrics-function.d.ts +2 -1
- package/dist/rules/metrics-function.d.ts.map +1 -1
- package/dist/rules/metrics-function.js +63 -39
- package/dist/rules/metrics-function.js.map +1 -1
- package/dist/rules/metrics.d.ts +2 -1
- package/dist/rules/metrics.d.ts.map +1 -1
- package/dist/rules/metrics.js +80 -47
- package/dist/rules/metrics.js.map +1 -1
- package/dist/smells/clusters.d.ts +78 -0
- package/dist/smells/clusters.d.ts.map +1 -0
- package/dist/smells/clusters.js +124 -0
- package/dist/smells/clusters.js.map +1 -0
- package/dist/smells/duplicate-bodies.d.ts +92 -5
- package/dist/smells/duplicate-bodies.d.ts.map +1 -1
- package/dist/smells/duplicate-bodies.js +203 -73
- package/dist/smells/duplicate-bodies.js.map +1 -1
- package/dist/smells/duplicate-report.d.ts +90 -0
- package/dist/smells/duplicate-report.d.ts.map +1 -0
- package/dist/smells/duplicate-report.js +344 -0
- package/dist/smells/duplicate-report.js.map +1 -0
- package/dist/smells/fingerprint.d.ts +20 -1
- package/dist/smells/fingerprint.d.ts.map +1 -1
- package/dist/smells/fingerprint.js +27 -3
- package/dist/smells/fingerprint.js.map +1 -1
- package/dist/smells/inconsistent-siblings.d.ts +128 -7
- package/dist/smells/inconsistent-siblings.d.ts.map +1 -1
- package/dist/smells/inconsistent-siblings.js +288 -86
- package/dist/smells/inconsistent-siblings.js.map +1 -1
- package/dist/smells/sibling-files.d.ts +47 -0
- package/dist/smells/sibling-files.d.ts.map +1 -0
- package/dist/smells/sibling-files.js +104 -0
- package/dist/smells/sibling-files.js.map +1 -0
- package/dist/smells/similar-pairs.d.ts +28 -0
- package/dist/smells/similar-pairs.d.ts.map +1 -0
- package/dist/smells/similar-pairs.js +134 -0
- package/dist/smells/similar-pairs.js.map +1 -0
- package/dist/smells/smell-builder.d.ts +57 -12
- package/dist/smells/smell-builder.d.ts.map +1 -1
- package/dist/smells/smell-builder.js +112 -14
- package/dist/smells/smell-builder.js.map +1 -1
- package/dist/smells/variation.d.ts +47 -0
- package/dist/smells/variation.d.ts.map +1 -0
- package/dist/smells/variation.js +90 -0
- package/dist/smells/variation.js.map +1 -0
- package/dist/tsconfig/index.d.ts +19 -0
- package/dist/tsconfig/index.d.ts.map +1 -0
- package/dist/tsconfig/index.js +20 -0
- package/dist/tsconfig/index.js.map +1 -0
- package/dist/tsconfig/tsconfig-builder.d.ts +42 -9
- package/dist/tsconfig/tsconfig-builder.d.ts.map +1 -1
- package/dist/tsconfig/tsconfig-builder.js +65 -16
- package/dist/tsconfig/tsconfig-builder.js.map +1 -1
- package/package.json +4 -2
- package/dist/core/module-dependencies.d.ts +0 -28
- package/dist/core/module-dependencies.d.ts.map +0 -1
- package/dist/core/module-dependencies.js +0 -35
- package/dist/core/module-dependencies.js.map +0 -1
- package/dist/helpers/within.d.ts.map +0 -1
- package/dist/helpers/within.js.map +0 -1
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import type { ArchProject } from './project.js';
|
|
2
|
+
import type { GlobPosition } from '@nielspeter/eess';
|
|
3
|
+
import type { GlobFault } from './glob-diagnosis.js';
|
|
4
|
+
import type { OnDisk } from './disk-set.js';
|
|
5
|
+
import type { RuleBuilderLike } from '@nielspeter/eess';
|
|
6
|
+
import type { GlobNode } from '@nielspeter/eess';
|
|
7
|
+
/**
|
|
8
|
+
* Anything `diagnose()` can inspect: a rule that can describe its globs.
|
|
9
|
+
*
|
|
10
|
+
* Structural rather than `TerminalBuilder`, so a caller can pass the same
|
|
11
|
+
* `RuleBuilderLike[]` array they already hand to `checkAll` without any
|
|
12
|
+
* of it being coupled to a class.
|
|
13
|
+
*/
|
|
14
|
+
export interface DiagnosableRule extends RuleBuilderLike {
|
|
15
|
+
globs?: () => readonly GlobNode[];
|
|
16
|
+
describeRule?: () => {
|
|
17
|
+
rule: string;
|
|
18
|
+
id?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Whether this rule asserts anything about what it selected.
|
|
22
|
+
*
|
|
23
|
+
* A method rather than a look at `_conditions`: that field is protected, and
|
|
24
|
+
* reading it would need a type assertion (ADR-005) to duck-type a private
|
|
25
|
+
* name that no subclass is obliged to keep. Optional, because only the
|
|
26
|
+
* predicate/condition builders can be in the condition-less state at all —
|
|
27
|
+
* the rest take their condition as a constructor argument.
|
|
28
|
+
*/
|
|
29
|
+
assertsSomething?: () => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The remedy for this rule's assertion-less state. When present, `diagnose`
|
|
32
|
+
* reports it VERBATIM as the finding's advice, so the doctor and the
|
|
33
|
+
* configuration finding the gate raises at runtime carry the same string by
|
|
34
|
+
* construction (plan 0070) — they were measured diverging, and two texts for
|
|
35
|
+
* one state is a trust problem for an agent diffing them. Absent, the base
|
|
36
|
+
* `TerminalBuilder` text is used, from the one place that owns it.
|
|
37
|
+
*/
|
|
38
|
+
assertionAdvice?: () => string;
|
|
39
|
+
/** The project this rule was built against. */
|
|
40
|
+
getProject?: () => ArchProject | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* How many units this rule's family examined — plan 0096.
|
|
43
|
+
*
|
|
44
|
+
* PUBLIC because `DiagnosableRule` is structural: a protected member cannot
|
|
45
|
+
* satisfy it, which is the recorded reason `assertsSomething()` is public.
|
|
46
|
+
*
|
|
47
|
+
* The unit differs per family and each names its own (ADR-010 part 1), but
|
|
48
|
+
* every family answers it from the SAME method its `collectViolations()` uses
|
|
49
|
+
* — not a parallel derivation. A first attempt at this plan let the two
|
|
50
|
+
* diverge and they disagreed within one commit.
|
|
51
|
+
*
|
|
52
|
+
* Calling it RUNS that materialization. `diagnose()` and `doctor` used to
|
|
53
|
+
* promise they reported "without running any of them"; that sentence changed
|
|
54
|
+
* with this plan, in the docs as well as here.
|
|
55
|
+
*/
|
|
56
|
+
examinedUnits?: () => number;
|
|
57
|
+
/**
|
|
58
|
+
* Whether this rule's emptiness was DECLARED — plan 0097, read here by 0096.
|
|
59
|
+
*
|
|
60
|
+
* Public for the same structural reason as `assertsSomething()`. Without it
|
|
61
|
+
* the preview reports a finding on a rule the gate will accept, and tells the
|
|
62
|
+
* reader to do the thing they already did.
|
|
63
|
+
*/
|
|
64
|
+
declaresEmpty?: () => boolean;
|
|
65
|
+
/**
|
|
66
|
+
* This rule's own zero-subjects advice — plan 0099.
|
|
67
|
+
*
|
|
68
|
+
* When present, reported VERBATIM, exactly as `assertionAdvice()` is and for
|
|
69
|
+
* the identical reason plan 0070 recorded: the doctor and the finding the gate
|
|
70
|
+
* raises must carry the same string **by construction**, because two texts for
|
|
71
|
+
* one state is a trust problem for an agent diffing them.
|
|
72
|
+
*
|
|
73
|
+
* Measured before this seam existed: `check()` said "a declaration is an
|
|
74
|
+
* assertion, not a silencer" while `doctor` still said "the declaration is not
|
|
75
|
+
* itself checked yet ... A later release makes this state fail at check time" —
|
|
76
|
+
* in the release that makes it fail, on the surface ts-archunit's `docs/upgrading.md` tells
|
|
77
|
+
* people to run first.
|
|
78
|
+
*/
|
|
79
|
+
zeroSubjectsAdvice?: () => string;
|
|
80
|
+
/**
|
|
81
|
+
* How this family spells the declaration. Absent means the generic
|
|
82
|
+
* `.expectEmpty()`, which is a `TypeError` on `crossProject` — see
|
|
83
|
+
* `TerminalBuilder.emptyDeclarationAdvice()`.
|
|
84
|
+
*/
|
|
85
|
+
emptyDeclarationAdvice?: () => string;
|
|
86
|
+
/**
|
|
87
|
+
* Whether a condition on this rule declares emptiness as its PASSING state —
|
|
88
|
+
* `.notExist()` and friends. Zero examined is the assertion succeeding, so the
|
|
89
|
+
* evidence check must not report it. See `TerminalBuilder.assertsCardinality()`
|
|
90
|
+
* for why this is separate from `declaresEmpty()`.
|
|
91
|
+
*/
|
|
92
|
+
assertsCardinality?: () => boolean;
|
|
93
|
+
/**
|
|
94
|
+
* This rule's own adequacy advice — plan 0102.
|
|
95
|
+
*
|
|
96
|
+
* Distinct from `zeroSubjectsAdvice`: that covers `examinedUnits() === 0`.
|
|
97
|
+
* This covers a rule whose evidence is non-empty but which is structurally
|
|
98
|
+
* unable to ever produce a finding as configured (bug 0077(A) — a
|
|
99
|
+
* divergence-policing detector on a majority-less corpus). Returns the empty
|
|
100
|
+
* string for any rule that is not inert, so `diagnose()` reports nothing for
|
|
101
|
+
* a healthy control. Reported VERBATIM, exactly as `zeroSubjectsAdvice` is,
|
|
102
|
+
* for the same plan-0070 reason: the preview and the check-time finding must
|
|
103
|
+
* carry the same string by construction, not two texts for one state.
|
|
104
|
+
*/
|
|
105
|
+
inertAdvice?: () => string;
|
|
106
|
+
/**
|
|
107
|
+
* This rule's own deferred-warning advice — plan 0090.
|
|
108
|
+
*
|
|
109
|
+
* A DEFERRED warning (`.asSeverity('warn', { accepted })`) stays `warn` only
|
|
110
|
+
* for violations whose subject is in `accepted`; this reports when a CURRENT
|
|
111
|
+
* violation is not — the exact regression an accepted list exists to catch.
|
|
112
|
+
* Returns `''` for an advisory warning, for a rule at `'error'` severity, and
|
|
113
|
+
* for a deferred warning whose findings are all still accepted, matching
|
|
114
|
+
* `inertAdvice`/`zeroSubjectsAdvice`'s own precedent: reported VERBATIM, so
|
|
115
|
+
* `doctor`'s preview and `checkAll()`/CLI `check`'s eventual failure carry the
|
|
116
|
+
* same string by construction.
|
|
117
|
+
*/
|
|
118
|
+
deferredWarningAdvice?: () => string;
|
|
119
|
+
}
|
|
120
|
+
/** One thing wrong with one rule, named specifically enough to fix. */
|
|
121
|
+
export interface DiagnosticFinding {
|
|
122
|
+
/**
|
|
123
|
+
* `'project-empty'` — the project loaded no files, so nothing can match and
|
|
124
|
+
* the globs are not the fault (bug 0031); `'dead-glob'` — a glob that can
|
|
125
|
+
* never match; `'no-condition'` — a rule
|
|
126
|
+
* that asserts nothing; `'project-unknown'` — a rule whose globs could not
|
|
127
|
+
* be checked because it cannot name the project it was built against.
|
|
128
|
+
*/
|
|
129
|
+
readonly kind: 'dead-glob' | 'no-condition' | 'project-unknown' | 'project-empty'
|
|
130
|
+
/**
|
|
131
|
+
* A rule that examined **zero units** while its project loaded files, and
|
|
132
|
+
* for which nothing else explained the emptiness — plan 0096.
|
|
133
|
+
*
|
|
134
|
+
* The preview for plan 0098, which makes the same state FAIL. Distinct from
|
|
135
|
+
* `'project-empty'` (the instrument loaded nothing) and from `'dead-glob'`
|
|
136
|
+
* (a glob the author wrote matches nothing): this is the family's OWN
|
|
137
|
+
* filters removing everything, including defaults the author never wrote.
|
|
138
|
+
*
|
|
139
|
+
* It lands in `diagnose()` rather than in `doctor` so that a rule file
|
|
140
|
+
* importing a test runner — which `doctor` cannot load, ADR-009 rule 1's
|
|
141
|
+
* corollary — still gets a preview: `expect(diagnose(rules)).toEqual([])`
|
|
142
|
+
* runs inside the consumer's own suite.
|
|
143
|
+
*/
|
|
144
|
+
| 'zero-subjects'
|
|
145
|
+
/**
|
|
146
|
+
* A rule whose evidence is non-empty but which is structurally unable to
|
|
147
|
+
* ever produce a finding as configured — plan 0102. Distinct from
|
|
148
|
+
* `'zero-subjects'`: that fires when `examinedUnits() === 0`; this fires
|
|
149
|
+
* when `examinedUnits() > 0` but the family's own adequacy predicate
|
|
150
|
+
* (`inertAdvice?()`) says the rule can never fail regardless. ADR-009's
|
|
151
|
+
* Notes hand this class to ADR-008 explicitly: "a check can examine 500
|
|
152
|
+
* subjects and still assert nothing worth knowing."
|
|
153
|
+
*/
|
|
154
|
+
| 'inert'
|
|
155
|
+
/**
|
|
156
|
+
* An inline `// eess-exclude` comment naming a rule id no rule
|
|
157
|
+
* declares, so it suppresses nothing — [ts-archunit bug 0044](https://github.com/nielspeter/ts-archunit/blob/main/bugs/fixed/0044-an-inline-exclusion-comment-has-no-feedback-channel.md).
|
|
158
|
+
*
|
|
159
|
+
* Produced by `orphanExclusions()`, never by `diagnose()`: it needs every
|
|
160
|
+
* rule at once, and `diagnose()` is called per rule file.
|
|
161
|
+
*/
|
|
162
|
+
| 'orphan-exclusion'
|
|
163
|
+
/**
|
|
164
|
+
* A DEFERRED warning (`.asSeverity('warn', { accepted })`) whose current
|
|
165
|
+
* findings are not all covered by `accepted` — plan 0090. The preview for
|
|
166
|
+
* the escalation `.violations()`/`checkAll()`/CLI `check` already apply: one
|
|
167
|
+
* of those findings will report at `error` severity the moment this rule
|
|
168
|
+
* runs. Distinct from `'inert'` and `'zero-subjects'`, which are about
|
|
169
|
+
* whether a rule can ever fail; this is about a rule that already fails,
|
|
170
|
+
* previewed before the run that discovers it does.
|
|
171
|
+
*/
|
|
172
|
+
| 'deferred-warning';
|
|
173
|
+
/** The rule's id if it has one, else its assembled description. */
|
|
174
|
+
readonly rule: string;
|
|
175
|
+
/** Where the glob was written: `resideInFolder("**\/src/x/**")`. */
|
|
176
|
+
readonly origin?: string;
|
|
177
|
+
readonly glob?: string;
|
|
178
|
+
readonly position?: GlobPosition;
|
|
179
|
+
readonly fault?: GlobFault;
|
|
180
|
+
readonly onDisk?: OnDisk;
|
|
181
|
+
/** The sanctioned fix, or an honest list of causes where none is verifiable. */
|
|
182
|
+
readonly advice: string;
|
|
183
|
+
/**
|
|
184
|
+
* For `'orphan-exclusion'`, the line the comment sits on.
|
|
185
|
+
*/
|
|
186
|
+
readonly line?: number;
|
|
187
|
+
/**
|
|
188
|
+
* For `'orphan-exclusion'`, the **source** file holding the comment.
|
|
189
|
+
*
|
|
190
|
+
* Distinct from `ruleFile`, which names where a *rule* was written. An earlier
|
|
191
|
+
* revision reused `ruleFile` for this and gave JSON consumers two different
|
|
192
|
+
* things under one name depending on `kind`.
|
|
193
|
+
*/
|
|
194
|
+
readonly sourceFile?: string;
|
|
195
|
+
/**
|
|
196
|
+
* The rule file this rule was written in, when the caller knows it.
|
|
197
|
+
*
|
|
198
|
+
* `diagnose()` never sets this — it is handed rules, not files, and inventing
|
|
199
|
+
* a path it cannot verify is the thing this library exists to stop. `doctor`
|
|
200
|
+
* sets it, because its loop over rule files is the only place the mapping
|
|
201
|
+
* exists (bug 0026: `docs/cli.md` claimed identities "in which rule" and that
|
|
202
|
+
* was true of a dead glob's position and false of every `no-condition`
|
|
203
|
+
* finding, whose only identity was a prose sentence).
|
|
204
|
+
*/
|
|
205
|
+
readonly ruleFile?: string;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Report what each rule cannot enforce, without evaluating their conditions.
|
|
209
|
+
*
|
|
210
|
+
* It DOES materialize each rule's selection, as of plan 0096 — "this rule
|
|
211
|
+
* examined nothing" is a fact about the selection. The docstring said "without
|
|
212
|
+
* running any of them" and that stopped being true; it is the IDE-hover contract
|
|
213
|
+
* for an exported function, so it is corrected here and not only in `docs/`.
|
|
214
|
+
*
|
|
215
|
+
* As of plan 0102, one family's `inertAdvice?()` goes further than selection:
|
|
216
|
+
* `inconsistentSiblings` walks every sibling body's AST to answer it (the same
|
|
217
|
+
* work `check()` does), so for that one family this IS evaluating the
|
|
218
|
+
* condition, not just counting what would be handed to it (review: architect).
|
|
219
|
+
* Still no `Condition.evaluate()` call — the boundary this docstring's
|
|
220
|
+
* predecessor drew — but "without evaluating" is no longer exactly right for
|
|
221
|
+
* every family, and is corrected here rather than left for the next reader to
|
|
222
|
+
* discover by profiling `doctor`.
|
|
223
|
+
*
|
|
224
|
+
* The in-process half of `doctor`. It exists because rules written inside
|
|
225
|
+
* vitest are a co-equal documented path (`docs/running-in-tests.md`), and a
|
|
226
|
+
* CLI-only diagnostic would leave half the users unable to measure before R3
|
|
227
|
+
* flips anything — which is the one job R2a has.
|
|
228
|
+
*
|
|
229
|
+
* Reports **identities, never totals**: which glob, in which rule, at which
|
|
230
|
+
* position. A count is a snapshot, and under ADR-009 rule 4 a snapshot is the
|
|
231
|
+
* thing that rots. Callers who want a number can take `.length`.
|
|
232
|
+
*/
|
|
233
|
+
export declare function diagnose(rules: readonly DiagnosableRule[], project?: ArchProject): DiagnosticFinding[];
|
|
234
|
+
//# sourceMappingURL=diagnose.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnose.d.ts","sourceRoot":"","sources":["../../src/core/diagnose.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAY,MAAM,kBAAkB,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAO3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAE,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A;IACrB,oEAAoE;IACpE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAA;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAA;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,gFAAgF;IAChF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B;;;;;;;;;OASG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,SAAS,eAAe,EAAE,EACjC,OAAO,CAAC,EAAE,WAAW,GACpB,iBAAiB,EAAE,CA2MrB"}
|
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
import { TerminalBuilder } from './terminal-builder.js';
|
|
2
|
+
import { diagnoseGlob, syntacticFault, FAULT_ADVICE, ON_DISK_ADVICE } from './glob-diagnosis.js';
|
|
3
|
+
import { globSitesOf, isDeadSite } from './glob-evaluator.js';
|
|
4
|
+
import { pathUniverse } from './path-universe.js';
|
|
5
|
+
import { diskSet } from './disk-set.js';
|
|
6
|
+
import { isDeadGlobTree } from './glob-evaluator.js';
|
|
7
|
+
import { emptyProjectAdvice, loadedNothing } from './empty-project-advice.js';
|
|
8
|
+
import { isFaultPosition } from '@nielspeter/eess/internal';
|
|
9
|
+
/**
|
|
10
|
+
* Report what each rule cannot enforce, without evaluating their conditions.
|
|
11
|
+
*
|
|
12
|
+
* It DOES materialize each rule's selection, as of plan 0096 — "this rule
|
|
13
|
+
* examined nothing" is a fact about the selection. The docstring said "without
|
|
14
|
+
* running any of them" and that stopped being true; it is the IDE-hover contract
|
|
15
|
+
* for an exported function, so it is corrected here and not only in `docs/`.
|
|
16
|
+
*
|
|
17
|
+
* As of plan 0102, one family's `inertAdvice?()` goes further than selection:
|
|
18
|
+
* `inconsistentSiblings` walks every sibling body's AST to answer it (the same
|
|
19
|
+
* work `check()` does), so for that one family this IS evaluating the
|
|
20
|
+
* condition, not just counting what would be handed to it (review: architect).
|
|
21
|
+
* Still no `Condition.evaluate()` call — the boundary this docstring's
|
|
22
|
+
* predecessor drew — but "without evaluating" is no longer exactly right for
|
|
23
|
+
* every family, and is corrected here rather than left for the next reader to
|
|
24
|
+
* discover by profiling `doctor`.
|
|
25
|
+
*
|
|
26
|
+
* The in-process half of `doctor`. It exists because rules written inside
|
|
27
|
+
* vitest are a co-equal documented path (`docs/running-in-tests.md`), and a
|
|
28
|
+
* CLI-only diagnostic would leave half the users unable to measure before R3
|
|
29
|
+
* flips anything — which is the one job R2a has.
|
|
30
|
+
*
|
|
31
|
+
* Reports **identities, never totals**: which glob, in which rule, at which
|
|
32
|
+
* position. A count is a snapshot, and under ADR-009 rule 4 a snapshot is the
|
|
33
|
+
* thing that rots. Callers who want a number can take `.length`.
|
|
34
|
+
*/
|
|
35
|
+
export function diagnose(rules, project) {
|
|
36
|
+
const findings = [];
|
|
37
|
+
/**
|
|
38
|
+
* Projects already reported empty, by OBJECT not by path.
|
|
39
|
+
*
|
|
40
|
+
* The path is not an identity: `workspace([...])` sets `tsConfigPath` to the
|
|
41
|
+
* alphabetically first of N configs (`project.ts`), so a `workspace()` and a
|
|
42
|
+
* `project()` naming that same config collided — and the loser was dropped
|
|
43
|
+
* silently, contributing no finding at all. A false green inside the fix for
|
|
44
|
+
* a false green. `project()` and `workspace()` are both memoized, so object
|
|
45
|
+
* identity IS project identity, and it is what `pathUniverse` and `diskSet`
|
|
46
|
+
* already key on.
|
|
47
|
+
*/
|
|
48
|
+
const emptyProjects = new WeakSet();
|
|
49
|
+
for (const rule of rules) {
|
|
50
|
+
const name = ruleName(rule);
|
|
51
|
+
// PER RULE, not once for the whole array. Taking the first project any
|
|
52
|
+
// rule could name and diagnosing everything against it is wrong in both
|
|
53
|
+
// directions: a rule file with two `project()` calls gets half its globs
|
|
54
|
+
// checked against the wrong universe — the documented monorepo hazard,
|
|
55
|
+
// committed by the diagnostic itself — and a file whose rules cannot name
|
|
56
|
+
// a project at all got silence.
|
|
57
|
+
// The rule's own project WINS over the parameter. Backwards, the parameter
|
|
58
|
+
// silently re-checks every rule against one universe — which is the
|
|
59
|
+
// documented monorepo hazard the paragraph above complains about, and the
|
|
60
|
+
// `project-unknown` advice used to recommend it. The parameter is a
|
|
61
|
+
// fallback for rules that cannot name a project, which is the only case it
|
|
62
|
+
// was ever needed for.
|
|
63
|
+
const target = rule.getProject?.() ?? project;
|
|
64
|
+
// Where this rule's findings begin, so the tail can ask whether anything
|
|
65
|
+
// else already explained an empty examination (plan 0096's precedence
|
|
66
|
+
// ruling). The gate has the same shape at `terminal-builder.ts` — each fault
|
|
67
|
+
// REPLACES what follows — and `diagnose()` must mirror it or the preview
|
|
68
|
+
// disagrees with the thing it previews.
|
|
69
|
+
//
|
|
70
|
+
// ABOVE the `no-condition` push, deliberately. It sat below on the first
|
|
71
|
+
// pass, so the tail could never see a missing assertion and measured
|
|
72
|
+
// ['no-condition','zero-subjects'] on three shapes — while the comment on
|
|
73
|
+
// the tail claimed a missing assertion already named a cause. The code
|
|
74
|
+
// contradicted its own comment.
|
|
75
|
+
const before = findings.length;
|
|
76
|
+
// A rule with a selector and no condition asserts nothing about what it
|
|
77
|
+
// selected. Reported here so that R3b's gate can see proposal 019 at all:
|
|
78
|
+
// a doctor that reported only glob faults would pass while 019's blast
|
|
79
|
+
// radius was completely unknown — this plan's own question, asked of its
|
|
80
|
+
// own gate.
|
|
81
|
+
if (hasNoCondition(rule)) {
|
|
82
|
+
findings.push({
|
|
83
|
+
kind: 'no-condition',
|
|
84
|
+
rule: name,
|
|
85
|
+
// The builder's own per-state remedy when it offers one — the same
|
|
86
|
+
// string the runtime prints — falling back to the generic form for a
|
|
87
|
+
// DiagnosableRule that predates the hook. The old fixed text here said
|
|
88
|
+
// "add a .should() clause", which is the wrong remedy for the main
|
|
89
|
+
// shape (the .should() is present; the condition is not).
|
|
90
|
+
// The builder's own per-state remedy. No literal fallback string here:
|
|
91
|
+
// an earlier revision hard-coded the generic text a second time, and a
|
|
92
|
+
// review measured either copy being rewritten with nothing failing —
|
|
93
|
+
// two strings in the mechanism whose stated purpose is one string, one
|
|
94
|
+
// place. A DiagnosableRule that predates the hook gets the base
|
|
95
|
+
// method's text, from the one place that owns it.
|
|
96
|
+
advice: rule.assertionAdvice?.() ?? TerminalBuilder.prototype.assertionAdvice.call(rule),
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
const trees = rule.globs?.() ?? [];
|
|
100
|
+
// Silence here would be a false green in the tool built to remove false
|
|
101
|
+
// greens: a rule that declares globs and cannot say which project to check
|
|
102
|
+
// them against used to be skipped, so a rule file made entirely of such
|
|
103
|
+
// rules reported a clean bill of health and exited 0 with every one of its
|
|
104
|
+
// globs unchecked. Say so instead.
|
|
105
|
+
//
|
|
106
|
+
// This comment used to name `crossLayer()` and `resolvers()` as the
|
|
107
|
+
// builders that could not name their project — and by the time it was read
|
|
108
|
+
// again, `48e3391` had given both a `getProject()`, so it named as examples
|
|
109
|
+
// the two shapes the fix had repaired. `tests/core/diagnose.test.ts` pins
|
|
110
|
+
// the truth in both directions: one test drives this branch, and a second
|
|
111
|
+
// asserts a `crossLayer` rule does NOT reach it. Hence no roster and no
|
|
112
|
+
// count here — a builder reaches this branch exactly when it implements no
|
|
113
|
+
// `getProject()` and no project was passed in, which is checked on the
|
|
114
|
+
// line below rather than remembered in prose.
|
|
115
|
+
if (!target) {
|
|
116
|
+
if (trees.length > 0) {
|
|
117
|
+
findings.push({
|
|
118
|
+
kind: 'project-unknown',
|
|
119
|
+
rule: name,
|
|
120
|
+
advice: 'this rule declares globs but cannot say which project it was built against, so they were not checked. A builder constructed directly rather than through its entry point has no project to report',
|
|
121
|
+
});
|
|
122
|
+
// ...but the syntactic faults do not need a project, so they are still
|
|
123
|
+
// reported here rather than held back for a run that may never happen.
|
|
124
|
+
findings.push(...syntacticFindings(name, trees));
|
|
125
|
+
}
|
|
126
|
+
// Evidence is a fact about the FAMILY, not about whether we could name its
|
|
127
|
+
// project — so this branch reports it too. Under the SAME gate as the tail:
|
|
128
|
+
// pushed unconditionally it produced ['project-unknown','dead-glob',
|
|
129
|
+
// 'zero-subjects'], the very shape this plan condemns, on the one path the
|
|
130
|
+
// ruling had not been extended to.
|
|
131
|
+
if (findings.length === before) {
|
|
132
|
+
const noProjectEvidence = zeroSubjectsFinding(rule, name);
|
|
133
|
+
if (noProjectEvidence !== undefined)
|
|
134
|
+
findings.push(noProjectEvidence);
|
|
135
|
+
}
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
// Bug 0031. When the project loaded nothing, EVERY glob is dead and none
|
|
139
|
+
// of them is the reason. Diagnosing them one by one produced six findings
|
|
140
|
+
// whose advice said "a path segment is misspelled" about correctly spelled
|
|
141
|
+
// globs, measured against a real adopting codebase whose root tsconfig is
|
|
142
|
+
// `"files": []` plus project references.
|
|
143
|
+
//
|
|
144
|
+
// The rule is not new here: `slice-rule-builder.ts` already states it —
|
|
145
|
+
// "blaming the glob would send the caller to the wrong file entirely" —
|
|
146
|
+
// and `check` printed the right cause in the same run this printed the
|
|
147
|
+
// wrong one.
|
|
148
|
+
//
|
|
149
|
+
// Once per PROJECT, not per rule and not per glob: the identity of this
|
|
150
|
+
// fault is the tsconfig, so that is what ADR-009 rule 4 asks be named.
|
|
151
|
+
// Deduped by path rather than by object because the path is what the
|
|
152
|
+
// message prints, and printing one sentence twice is the thing being
|
|
153
|
+
// fixed.
|
|
154
|
+
if (loadedNothing(target)) {
|
|
155
|
+
if (!emptyProjects.has(target)) {
|
|
156
|
+
emptyProjects.add(target);
|
|
157
|
+
findings.push({
|
|
158
|
+
kind: 'project-empty',
|
|
159
|
+
rule: name,
|
|
160
|
+
// One owner, shared with the builder's failing-check message. The
|
|
161
|
+
// clause "Reported once for this project" used to be here and was
|
|
162
|
+
// FALSE on the primary surface: `doctor` calls `diagnose()` once per
|
|
163
|
+
// rule file, so two files against one empty tsconfig printed the
|
|
164
|
+
// sentence claiming it was printed once, twice. Measured by review.
|
|
165
|
+
advice: emptyProjectAdvice(target),
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
// The syntactic faults survive an empty project: they are properties of
|
|
169
|
+
// the glob text, not of what loaded, so withholding them buys the reader
|
|
170
|
+
// a second failing round trip.
|
|
171
|
+
findings.push(...syntacticFindings(name, trees));
|
|
172
|
+
// Skip the rest of the glob walk. Not an optimisation — reporting those
|
|
173
|
+
// globs is the bug, because every one would carry a cause that is false.
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
const universe = pathUniverse(target);
|
|
177
|
+
for (const tree of trees) {
|
|
178
|
+
// Only diagnose sites inside a tree that is actually dead. A live tree
|
|
179
|
+
// may still contain a dead site — `or(dead, live)` is a working rule —
|
|
180
|
+
// and reporting the dead one there is the false red the tree exists to
|
|
181
|
+
// prevent.
|
|
182
|
+
if (!isDeadGlobTree(tree, universe))
|
|
183
|
+
continue;
|
|
184
|
+
for (const site of globSitesOf(tree)) {
|
|
185
|
+
// An exclusion matching zero is remedy-optional (proposal 006) and
|
|
186
|
+
// never a fault, and a positive condition glob is indistinguishable
|
|
187
|
+
// from an armed tripwire that has not fired. Reporting either asserts
|
|
188
|
+
// a remedy for a non-fault — and `position` used to be copied into the
|
|
189
|
+
// finding and never read, so both fired.
|
|
190
|
+
if (!isFaultPosition(site.position))
|
|
191
|
+
continue;
|
|
192
|
+
if (!isDeadSite(site, universe))
|
|
193
|
+
continue;
|
|
194
|
+
findings.push(describe(site, name, universe, target));
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
// LAST, and only if nothing else spoke for this rule. A dead glob, a missing
|
|
198
|
+
// assertion or an empty project each already names a cause with its own
|
|
199
|
+
// remedy; adding "your narrowing removed everything" beside one of them
|
|
200
|
+
// prints the derived symptom above the root cause, with advice that is false
|
|
201
|
+
// on that path. The first attempt emitted this first and unconditionally,
|
|
202
|
+
// which measured as ['zero-subjects','dead-glob'] for a single typo and
|
|
203
|
+
// broke the invariant bug 0040 is filed for — that `diagnose()` and the gate
|
|
204
|
+
// agree about a dead discovery glob.
|
|
205
|
+
if (findings.length === before) {
|
|
206
|
+
const evidence = zeroSubjectsFinding(rule, name);
|
|
207
|
+
if (evidence !== undefined)
|
|
208
|
+
findings.push(evidence);
|
|
209
|
+
}
|
|
210
|
+
// A DISTINCT branch, not folded into the zeroSubjectsFinding guard above:
|
|
211
|
+
// inertAdvice() only returns non-empty when examinedUnits() > 0 (plan
|
|
212
|
+
// 0102's own guard requires `matching > 0`), so the two are structurally
|
|
213
|
+
// mutually exclusive and this never doubles up with the zero-subjects
|
|
214
|
+
// finding above. Unconditional (not gated on `findings.length === before`)
|
|
215
|
+
// because the emptiness precedence above governs a different axis
|
|
216
|
+
// (evidence present vs. absent); this axis is evidence present vs.
|
|
217
|
+
// adequate, and nothing else in this loop speaks to it.
|
|
218
|
+
const inert = inertFinding(rule, name);
|
|
219
|
+
if (inert !== undefined)
|
|
220
|
+
findings.push(inert);
|
|
221
|
+
// Also unconditional, and naturally exclusive from the two branches above:
|
|
222
|
+
// `deferredWarningAdvice()` only fires when `.violations()` returns at
|
|
223
|
+
// least one `error`-severity result, which cannot happen when examined
|
|
224
|
+
// units is zero (zero-subjects) or the family's own adequacy predicate says
|
|
225
|
+
// this rule can never produce a finding (inert) — both of those states mean
|
|
226
|
+
// no violations at all, so `breaching.length` is `0` and this stays silent.
|
|
227
|
+
const deferred = deferredWarningFinding(rule, name);
|
|
228
|
+
if (deferred !== undefined)
|
|
229
|
+
findings.push(deferred);
|
|
230
|
+
}
|
|
231
|
+
return findings;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* A rule that examined nothing, when nothing else explained why — plan 0096.
|
|
235
|
+
*
|
|
236
|
+
* Returns `undefined` unless the family answers `examinedUnits()` and answered
|
|
237
|
+
* zero. Two callers, on purpose: the project-unknown branch (a family with no
|
|
238
|
+
* project still has evidence — `crossProject` and `schemaFromSDL` have no
|
|
239
|
+
* `ArchProject` at all, and the first attempt gated this on one and gave those
|
|
240
|
+
* two families no preview whatsoever) and the tail of the normal path.
|
|
241
|
+
*
|
|
242
|
+
* NOT called from the project-empty branch. That fault is the instrument, it
|
|
243
|
+
* already has its own finding, and reporting both would print one fault twice
|
|
244
|
+
* — and prefigure 0098's precedence backwards, where an empty project outranks
|
|
245
|
+
* every declaration because a declaration asserts a fact about a loaded corpus.
|
|
246
|
+
*/
|
|
247
|
+
function zeroSubjectsFinding(rule, name) {
|
|
248
|
+
if (rule.examinedUnits === undefined)
|
|
249
|
+
return undefined;
|
|
250
|
+
if (rule.examinedUnits() !== 0)
|
|
251
|
+
return undefined;
|
|
252
|
+
// The author said empty is the point. Reporting anyway would make the advice
|
|
253
|
+
// below a remedy the reader has already applied — ADR-009 rule 2's loop — and
|
|
254
|
+
// would over-report against 0098's floor, which honours the same mint. That
|
|
255
|
+
// the mint exists at all is why 0097 shipped first; this is its first reader.
|
|
256
|
+
if (rule.declaresEmpty?.() === true)
|
|
257
|
+
return undefined;
|
|
258
|
+
// `.notExist()` examines zero BECAUSE that is what it asserts — the gate has
|
|
259
|
+
// exempted this since 0.34.0 and the preview must agree, or `doctor` reports a
|
|
260
|
+
// working rule as broken. Plan 0098: the rule-builder family is the first to
|
|
261
|
+
// report evidence, so this is the first release in which the two could differ.
|
|
262
|
+
if (rule.assertsCardinality?.() === true)
|
|
263
|
+
return undefined;
|
|
264
|
+
return {
|
|
265
|
+
kind: 'zero-subjects',
|
|
266
|
+
rule: name,
|
|
267
|
+
// ONE cause, because precedence has already removed the others: this fires
|
|
268
|
+
// only when no dead glob, missing assertion or empty project explained the
|
|
269
|
+
// emptiness first. So the remedy can name that cause without the hedging
|
|
270
|
+
// ADR-009 rule 2 forbids — and it must not say "your filters", because the
|
|
271
|
+
// commonest trigger is a default the author never wrote (`minLines` is 5).
|
|
272
|
+
// VERBATIM from the rule when it can speak, so this preview and the gate
|
|
273
|
+
// cannot drift. The fallback is for a foreign dialect that predates the seam;
|
|
274
|
+
// it deliberately no longer promises "a later release makes this fail" — that
|
|
275
|
+
// release is this one.
|
|
276
|
+
// NO fallback literal. It was a six-line copy of the producer's sentence —
|
|
277
|
+
// dead for every real builder (every `TerminalBuilder` has the method), never
|
|
278
|
+
// referenced by a test, and already diverging: no unit noun, no file count,
|
|
279
|
+
// no narrowing hint. The seam exists because "two texts for one state is the
|
|
280
|
+
// plan-0070 drift shape"; a fallback is that second text, one level down, in
|
|
281
|
+
// the commit that added the seam.
|
|
282
|
+
//
|
|
283
|
+
// A duck-typed `DiagnosableRule` that cannot answer simply has no advice to
|
|
284
|
+
// report, which is honest — better than core inventing a sentence for a
|
|
285
|
+
// family whose units and remedies it does not know.
|
|
286
|
+
advice: rule.zeroSubjectsAdvice?.() ??
|
|
287
|
+
'this rule examined 0 units, so it enforces nothing as written today.',
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* A rule whose evidence is non-empty but which is structurally unable to ever
|
|
292
|
+
* produce a finding as configured — plan 0102, bug 0077(A).
|
|
293
|
+
*
|
|
294
|
+
* Mirrors `zeroSubjectsFinding`'s shape: returns `undefined` unless the family
|
|
295
|
+
* answers `inertAdvice()` and answers non-empty. No fallback literal, for the
|
|
296
|
+
* same reason `zeroSubjectsFinding` has none — a family that cannot answer has
|
|
297
|
+
* no advice to report, which is honest; core does not invent a sentence for an
|
|
298
|
+
* adequacy predicate it does not own.
|
|
299
|
+
*/
|
|
300
|
+
function inertFinding(rule, name) {
|
|
301
|
+
return adviceFinding('inert', name, rule.inertAdvice?.());
|
|
302
|
+
}
|
|
303
|
+
/** A deferred warning whose accepted list no longer covers everything it finds — plan 0090. */
|
|
304
|
+
function deferredWarningFinding(rule, name) {
|
|
305
|
+
return adviceFinding('deferred-warning', name, rule.deferredWarningAdvice?.());
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* A finding that exists only if the family had something to say.
|
|
309
|
+
*
|
|
310
|
+
* `undefined` and `''` are the same answer — "this family declines to advise"
|
|
311
|
+
* — and treating them alike in ONE place is why an unimplemented hook and an
|
|
312
|
+
* implemented-but-silent one cannot diverge. A finding whose `advice` is the
|
|
313
|
+
* empty string renders as a heading with nothing under it, which reads to the
|
|
314
|
+
* author as a diagnosis that was cut off rather than one that was declined.
|
|
315
|
+
*/
|
|
316
|
+
function adviceFinding(kind, name, advice) {
|
|
317
|
+
if (advice === undefined || advice === '')
|
|
318
|
+
return undefined;
|
|
319
|
+
return { kind, rule: name, advice };
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* The faults that need no project at all, reported on the branches that have none.
|
|
323
|
+
*
|
|
324
|
+
* `syntacticFault` takes `(glob, kind, base)` — no universe, no project — and
|
|
325
|
+
* is split out for exactly that reason. `'./src/**'` is dead in every possible
|
|
326
|
+
* project; loading the tsconfig will not fix it. Both early exits below (the
|
|
327
|
+
* project is unknown, the project is empty) used to swallow these, so the
|
|
328
|
+
* reader corrected their config, re-ran, and only then learned the glob was
|
|
329
|
+
* also malformed — a second round trip for a fault already decided.
|
|
330
|
+
*
|
|
331
|
+
* Reported by review. Applies to the pre-existing `project-unknown` branch too,
|
|
332
|
+
* which had the same hole.
|
|
333
|
+
*/
|
|
334
|
+
function syntacticFindings(rule, trees) {
|
|
335
|
+
const findings = [];
|
|
336
|
+
for (const tree of trees) {
|
|
337
|
+
for (const site of globSitesOf(tree)) {
|
|
338
|
+
// Same position filter as the main path: an exclusion or condition glob
|
|
339
|
+
// matching nothing is not a fault, and that does not change because the
|
|
340
|
+
// fault is syntactic.
|
|
341
|
+
if (!isFaultPosition(site.position))
|
|
342
|
+
continue;
|
|
343
|
+
const fault = syntacticFault(site.glob, site.kind, site.base);
|
|
344
|
+
if (fault === undefined)
|
|
345
|
+
continue;
|
|
346
|
+
findings.push({
|
|
347
|
+
kind: 'dead-glob',
|
|
348
|
+
rule,
|
|
349
|
+
origin: site.origin,
|
|
350
|
+
glob: site.glob,
|
|
351
|
+
position: site.position,
|
|
352
|
+
fault,
|
|
353
|
+
advice: FAULT_ADVICE[fault],
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
return findings;
|
|
358
|
+
}
|
|
359
|
+
function describe(site, rule, universe, project) {
|
|
360
|
+
// The disk set is reached only from here, so a project with no dead globs
|
|
361
|
+
// never walks the filesystem.
|
|
362
|
+
const diagnosis = diagnoseGlob(site, universe, diskSet(project));
|
|
363
|
+
const onDiskAdvice = diagnosis.onDisk ? ON_DISK_ADVICE[diagnosis.onDisk] : '';
|
|
364
|
+
return {
|
|
365
|
+
kind: 'dead-glob',
|
|
366
|
+
rule,
|
|
367
|
+
origin: site.origin,
|
|
368
|
+
glob: site.glob,
|
|
369
|
+
position: site.position,
|
|
370
|
+
fault: diagnosis.fault,
|
|
371
|
+
onDisk: diagnosis.onDisk,
|
|
372
|
+
advice: onDiskAdvice === '' ? FAULT_ADVICE[diagnosis.fault] : onDiskAdvice,
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
function ruleName(rule) {
|
|
376
|
+
const described = rule.describeRule?.();
|
|
377
|
+
// `||` throughout, never `??`: `describeRule()` returns `rule: ''` for a bare
|
|
378
|
+
// entry point (no predicates, no conditions), and `'' ` is not nullish — so
|
|
379
|
+
// `?? 'unnamed rule'` made the fallback dead code and `doctor` printed an
|
|
380
|
+
// empty rule name for precisely the shape this diagnostic is about. Caught by
|
|
381
|
+
// sabotage, not by reading. The gate derives the same name in
|
|
382
|
+
// `TerminalBuilder.collectWithAssertionGuard`; both must be non-empty, and
|
|
383
|
+
// both are asserted so.
|
|
384
|
+
return described?.id || described?.rule || 'unnamed rule';
|
|
385
|
+
}
|
|
386
|
+
/** Whether the rule reached a terminal with no condition attached. */
|
|
387
|
+
function hasNoCondition(rule) {
|
|
388
|
+
return rule.assertsSomething?.() === false;
|
|
389
|
+
}
|
|
390
|
+
//# sourceMappingURL=diagnose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnose.js","sourceRoot":"","sources":["../../src/core/diagnose.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAKvD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAChG,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAG7E,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAkN3D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,QAAQ,CACtB,KAAiC,EACjC,OAAqB;IAErB,MAAM,QAAQ,GAAwB,EAAE,CAAA;IACxC;;;;;;;;;;OAUG;IACH,MAAM,aAAa,GAAG,IAAI,OAAO,EAAe,CAAA;IAEhD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;QAE3B,uEAAuE;QACvE,wEAAwE;QACxE,yEAAyE;QACzE,uEAAuE;QACvE,0EAA0E;QAC1E,gCAAgC;QAChC,2EAA2E;QAC3E,oEAAoE;QACpE,0EAA0E;QAC1E,oEAAoE;QACpE,2EAA2E;QAC3E,uBAAu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