driftdetect-core 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/boundaries/types.d.ts +1 -1
- package/dist/boundaries/types.d.ts.map +1 -1
- package/dist/call-graph/analysis/graph-builder.d.ts.map +1 -1
- package/dist/call-graph/analysis/graph-builder.js +1 -0
- package/dist/call-graph/analysis/graph-builder.js.map +1 -1
- package/dist/call-graph/extractors/go-data-access-extractor.d.ts +80 -0
- package/dist/call-graph/extractors/go-data-access-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/go-data-access-extractor.js +457 -0
- package/dist/call-graph/extractors/go-data-access-extractor.js.map +1 -0
- package/dist/call-graph/extractors/go-extractor.d.ts +103 -0
- package/dist/call-graph/extractors/go-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/go-extractor.js +509 -0
- package/dist/call-graph/extractors/go-extractor.js.map +1 -0
- package/dist/call-graph/extractors/go-hybrid-extractor.d.ts +97 -0
- package/dist/call-graph/extractors/go-hybrid-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/go-hybrid-extractor.js +496 -0
- package/dist/call-graph/extractors/go-hybrid-extractor.js.map +1 -0
- package/dist/call-graph/extractors/regex/go-regex.d.ts +51 -0
- package/dist/call-graph/extractors/regex/go-regex.d.ts.map +1 -0
- package/dist/call-graph/extractors/regex/go-regex.js +435 -0
- package/dist/call-graph/extractors/regex/go-regex.js.map +1 -0
- package/dist/call-graph/extractors/regex/index.d.ts +1 -0
- package/dist/call-graph/extractors/regex/index.d.ts.map +1 -1
- package/dist/call-graph/extractors/regex/index.js +8 -0
- package/dist/call-graph/extractors/regex/index.js.map +1 -1
- package/dist/call-graph/index.d.ts +3 -0
- package/dist/call-graph/index.d.ts.map +1 -1
- package/dist/call-graph/index.js +5 -0
- package/dist/call-graph/index.js.map +1 -1
- package/dist/call-graph/types.d.ts +1 -1
- package/dist/call-graph/types.d.ts.map +1 -1
- package/dist/constraints/extraction/constraint-synthesizer.d.ts +72 -0
- package/dist/constraints/extraction/constraint-synthesizer.d.ts.map +1 -0
- package/dist/constraints/extraction/constraint-synthesizer.js +336 -0
- package/dist/constraints/extraction/constraint-synthesizer.js.map +1 -0
- package/dist/constraints/extraction/index.d.ts +10 -0
- package/dist/constraints/extraction/index.d.ts.map +1 -0
- package/dist/constraints/extraction/index.js +10 -0
- package/dist/constraints/extraction/index.js.map +1 -0
- package/dist/constraints/extraction/invariant-detector.d.ts +109 -0
- package/dist/constraints/extraction/invariant-detector.d.ts.map +1 -0
- package/dist/constraints/extraction/invariant-detector.js +979 -0
- package/dist/constraints/extraction/invariant-detector.js.map +1 -0
- package/dist/constraints/index.d.ts +15 -0
- package/dist/constraints/index.d.ts.map +1 -0
- package/dist/constraints/index.js +16 -0
- package/dist/constraints/index.js.map +1 -0
- package/dist/constraints/store/constraint-store.d.ts +110 -0
- package/dist/constraints/store/constraint-store.d.ts.map +1 -0
- package/dist/constraints/store/constraint-store.js +584 -0
- package/dist/constraints/store/constraint-store.js.map +1 -0
- package/dist/constraints/types.d.ts +605 -0
- package/dist/constraints/types.d.ts.map +1 -0
- package/dist/constraints/types.js +57 -0
- package/dist/constraints/types.js.map +1 -0
- package/dist/constraints/verification/constraint-verifier.d.ts +100 -0
- package/dist/constraints/verification/constraint-verifier.d.ts.map +1 -0
- package/dist/constraints/verification/constraint-verifier.js +638 -0
- package/dist/constraints/verification/constraint-verifier.js.map +1 -0
- package/dist/constraints/verification/index.d.ts +8 -0
- package/dist/constraints/verification/index.d.ts.map +1 -0
- package/dist/constraints/verification/index.js +8 -0
- package/dist/constraints/verification/index.js.map +1 -0
- package/dist/decisions/analyzer/decision-mining-analyzer.d.ts +121 -0
- package/dist/decisions/analyzer/decision-mining-analyzer.d.ts.map +1 -0
- package/dist/decisions/analyzer/decision-mining-analyzer.js +904 -0
- package/dist/decisions/analyzer/decision-mining-analyzer.js.map +1 -0
- package/dist/decisions/analyzer/index.d.ts +5 -0
- package/dist/decisions/analyzer/index.d.ts.map +1 -0
- package/dist/decisions/analyzer/index.js +5 -0
- package/dist/decisions/analyzer/index.js.map +1 -0
- package/dist/decisions/extractors/base-commit-extractor.d.ts +104 -0
- package/dist/decisions/extractors/base-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/base-commit-extractor.js +305 -0
- package/dist/decisions/extractors/base-commit-extractor.js.map +1 -0
- package/dist/decisions/extractors/csharp-commit-extractor.d.ts +18 -0
- package/dist/decisions/extractors/csharp-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/csharp-commit-extractor.js +281 -0
- package/dist/decisions/extractors/csharp-commit-extractor.js.map +1 -0
- package/dist/decisions/extractors/index.d.ts +31 -0
- package/dist/decisions/extractors/index.d.ts.map +1 -0
- package/dist/decisions/extractors/index.js +63 -0
- package/dist/decisions/extractors/index.js.map +1 -0
- package/dist/decisions/extractors/java-commit-extractor.d.ts +18 -0
- package/dist/decisions/extractors/java-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/java-commit-extractor.js +248 -0
- package/dist/decisions/extractors/java-commit-extractor.js.map +1 -0
- package/dist/decisions/extractors/php-commit-extractor.d.ts +18 -0
- package/dist/decisions/extractors/php-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/php-commit-extractor.js +280 -0
- package/dist/decisions/extractors/php-commit-extractor.js.map +1 -0
- package/dist/decisions/extractors/python-commit-extractor.d.ts +18 -0
- package/dist/decisions/extractors/python-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/python-commit-extractor.js +248 -0
- package/dist/decisions/extractors/python-commit-extractor.js.map +1 -0
- package/dist/decisions/extractors/typescript-commit-extractor.d.ts +37 -0
- package/dist/decisions/extractors/typescript-commit-extractor.d.ts.map +1 -0
- package/dist/decisions/extractors/typescript-commit-extractor.js +229 -0
- package/dist/decisions/extractors/typescript-commit-extractor.js.map +1 -0
- package/dist/decisions/git/commit-parser.d.ts +58 -0
- package/dist/decisions/git/commit-parser.d.ts.map +1 -0
- package/dist/decisions/git/commit-parser.js +344 -0
- package/dist/decisions/git/commit-parser.js.map +1 -0
- package/dist/decisions/git/diff-analyzer.d.ts +30 -0
- package/dist/decisions/git/diff-analyzer.d.ts.map +1 -0
- package/dist/decisions/git/diff-analyzer.js +492 -0
- package/dist/decisions/git/diff-analyzer.js.map +1 -0
- package/dist/decisions/git/git-walker.d.ts +64 -0
- package/dist/decisions/git/git-walker.d.ts.map +1 -0
- package/dist/decisions/git/git-walker.js +441 -0
- package/dist/decisions/git/git-walker.js.map +1 -0
- package/dist/decisions/git/index.d.ts +11 -0
- package/dist/decisions/git/index.d.ts.map +1 -0
- package/dist/decisions/git/index.js +13 -0
- package/dist/decisions/git/index.js.map +1 -0
- package/dist/decisions/git/types.d.ts +223 -0
- package/dist/decisions/git/types.d.ts.map +1 -0
- package/dist/decisions/git/types.js +7 -0
- package/dist/decisions/git/types.js.map +1 -0
- package/dist/decisions/index.d.ts +27 -0
- package/dist/decisions/index.d.ts.map +1 -0
- package/dist/decisions/index.js +45 -0
- package/dist/decisions/index.js.map +1 -0
- package/dist/decisions/types.d.ts +530 -0
- package/dist/decisions/types.d.ts.map +1 -0
- package/dist/decisions/types.js +8 -0
- package/dist/decisions/types.js.map +1 -0
- package/dist/go/go-analyzer.d.ts +203 -0
- package/dist/go/go-analyzer.d.ts.map +1 -0
- package/dist/go/go-analyzer.js +509 -0
- package/dist/go/go-analyzer.js.map +1 -0
- package/dist/go/index.d.ts +7 -0
- package/dist/go/index.d.ts.map +1 -0
- package/dist/go/index.js +8 -0
- package/dist/go/index.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +56 -0
- package/dist/index.js.map +1 -1
- package/dist/parsers/tree-sitter/go-loader.d.ts +50 -0
- package/dist/parsers/tree-sitter/go-loader.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/go-loader.js +161 -0
- package/dist/parsers/tree-sitter/go-loader.js.map +1 -0
- package/dist/parsers/tree-sitter/tree-sitter-go-parser.d.ts +250 -0
- package/dist/parsers/tree-sitter/tree-sitter-go-parser.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/tree-sitter-go-parser.js +707 -0
- package/dist/parsers/tree-sitter/tree-sitter-go-parser.js.map +1 -0
- package/dist/parsers/types.d.ts +1 -1
- package/dist/parsers/types.d.ts.map +1 -1
- package/dist/simulation/approach-generator.d.ts +73 -0
- package/dist/simulation/approach-generator.d.ts.map +1 -0
- package/dist/simulation/approach-generator.js +371 -0
- package/dist/simulation/approach-generator.js.map +1 -0
- package/dist/simulation/index.d.ts +14 -0
- package/dist/simulation/index.d.ts.map +1 -0
- package/dist/simulation/index.js +19 -0
- package/dist/simulation/index.js.map +1 -0
- package/dist/simulation/language-strategies/csharp-strategies.d.ts +17 -0
- package/dist/simulation/language-strategies/csharp-strategies.d.ts.map +1 -0
- package/dist/simulation/language-strategies/csharp-strategies.js +118 -0
- package/dist/simulation/language-strategies/csharp-strategies.js.map +1 -0
- package/dist/simulation/language-strategies/index.d.ts +41 -0
- package/dist/simulation/language-strategies/index.d.ts.map +1 -0
- package/dist/simulation/language-strategies/index.js +92 -0
- package/dist/simulation/language-strategies/index.js.map +1 -0
- package/dist/simulation/language-strategies/java-strategies.d.ts +17 -0
- package/dist/simulation/language-strategies/java-strategies.d.ts.map +1 -0
- package/dist/simulation/language-strategies/java-strategies.js +119 -0
- package/dist/simulation/language-strategies/java-strategies.js.map +1 -0
- package/dist/simulation/language-strategies/php-strategies.d.ts +17 -0
- package/dist/simulation/language-strategies/php-strategies.d.ts.map +1 -0
- package/dist/simulation/language-strategies/php-strategies.js +129 -0
- package/dist/simulation/language-strategies/php-strategies.js.map +1 -0
- package/dist/simulation/language-strategies/python-strategies.d.ts +17 -0
- package/dist/simulation/language-strategies/python-strategies.d.ts.map +1 -0
- package/dist/simulation/language-strategies/python-strategies.js +208 -0
- package/dist/simulation/language-strategies/python-strategies.js.map +1 -0
- package/dist/simulation/language-strategies/types.d.ts +67 -0
- package/dist/simulation/language-strategies/types.d.ts.map +1 -0
- package/dist/simulation/language-strategies/types.js +23 -0
- package/dist/simulation/language-strategies/types.js.map +1 -0
- package/dist/simulation/language-strategies/typescript-strategies.d.ts +17 -0
- package/dist/simulation/language-strategies/typescript-strategies.d.ts.map +1 -0
- package/dist/simulation/language-strategies/typescript-strategies.js +251 -0
- package/dist/simulation/language-strategies/typescript-strategies.js.map +1 -0
- package/dist/simulation/scorers/friction-scorer.d.ts +45 -0
- package/dist/simulation/scorers/friction-scorer.d.ts.map +1 -0
- package/dist/simulation/scorers/friction-scorer.js +336 -0
- package/dist/simulation/scorers/friction-scorer.js.map +1 -0
- package/dist/simulation/scorers/impact-scorer.d.ts +56 -0
- package/dist/simulation/scorers/impact-scorer.d.ts.map +1 -0
- package/dist/simulation/scorers/impact-scorer.js +273 -0
- package/dist/simulation/scorers/impact-scorer.js.map +1 -0
- package/dist/simulation/scorers/index.d.ts +12 -0
- package/dist/simulation/scorers/index.d.ts.map +1 -0
- package/dist/simulation/scorers/index.js +12 -0
- package/dist/simulation/scorers/index.js.map +1 -0
- package/dist/simulation/scorers/pattern-alignment-scorer.d.ts +83 -0
- package/dist/simulation/scorers/pattern-alignment-scorer.d.ts.map +1 -0
- package/dist/simulation/scorers/pattern-alignment-scorer.js +367 -0
- package/dist/simulation/scorers/pattern-alignment-scorer.js.map +1 -0
- package/dist/simulation/scorers/security-scorer.d.ts +63 -0
- package/dist/simulation/scorers/security-scorer.d.ts.map +1 -0
- package/dist/simulation/scorers/security-scorer.js +346 -0
- package/dist/simulation/scorers/security-scorer.js.map +1 -0
- package/dist/simulation/simulation-engine.d.ts +89 -0
- package/dist/simulation/simulation-engine.d.ts.map +1 -0
- package/dist/simulation/simulation-engine.js +480 -0
- package/dist/simulation/simulation-engine.js.map +1 -0
- package/dist/simulation/types.d.ts +200 -0
- package/dist/simulation/types.d.ts.map +1 -0
- package/dist/simulation/types.js +23 -0
- package/dist/simulation/types.js.map +1 -0
- package/dist/speculative/approach-generator.d.ts +2 -0
- package/dist/speculative/approach-generator.d.ts.map +1 -0
- package/dist/speculative/approach-generator.js +2 -0
- package/dist/speculative/approach-generator.js.map +1 -0
- package/dist/speculative/templates/types.d.ts +133 -0
- package/dist/speculative/templates/types.d.ts.map +1 -0
- package/dist/speculative/templates/types.js +208 -0
- package/dist/speculative/templates/types.js.map +1 -0
- package/dist/speculative/types.d.ts +523 -0
- package/dist/speculative/types.d.ts.map +1 -0
- package/dist/speculative/types.js +71 -0
- package/dist/speculative/types.js.map +1 -0
- package/dist/test-topology/extractors/base-test-extractor.d.ts +1 -1
- package/dist/test-topology/extractors/base-test-extractor.d.ts.map +1 -1
- package/dist/test-topology/extractors/base-test-extractor.js.map +1 -1
- package/dist/test-topology/extractors/go-test-extractor.d.ts +33 -0
- package/dist/test-topology/extractors/go-test-extractor.d.ts.map +1 -0
- package/dist/test-topology/extractors/go-test-extractor.js +436 -0
- package/dist/test-topology/extractors/go-test-extractor.js.map +1 -0
- package/dist/test-topology/extractors/index.d.ts +1 -0
- package/dist/test-topology/extractors/index.d.ts.map +1 -1
- package/dist/test-topology/extractors/index.js +1 -0
- package/dist/test-topology/extractors/index.js.map +1 -1
- package/dist/test-topology/extractors/regex/go-test-regex.d.ts +62 -0
- package/dist/test-topology/extractors/regex/go-test-regex.d.ts.map +1 -0
- package/dist/test-topology/extractors/regex/go-test-regex.js +528 -0
- package/dist/test-topology/extractors/regex/go-test-regex.js.map +1 -0
- package/dist/test-topology/extractors/regex/index.d.ts +1 -0
- package/dist/test-topology/extractors/regex/index.d.ts.map +1 -1
- package/dist/test-topology/extractors/regex/index.js +4 -0
- package/dist/test-topology/extractors/regex/index.js.map +1 -1
- package/dist/test-topology/hybrid-test-topology-analyzer.d.ts.map +1 -1
- package/dist/test-topology/hybrid-test-topology-analyzer.js +1 -0
- package/dist/test-topology/hybrid-test-topology-analyzer.js.map +1 -1
- package/dist/test-topology/test-topology-analyzer.d.ts.map +1 -1
- package/dist/test-topology/test-topology-analyzer.js +1 -0
- package/dist/test-topology/test-topology-analyzer.js.map +1 -1
- package/dist/test-topology/types.d.ts +2 -2
- package/dist/test-topology/types.d.ts.map +1 -1
- package/dist/unified-provider/matching/database-sql-matcher.d.ts +42 -0
- package/dist/unified-provider/matching/database-sql-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/database-sql-matcher.js +282 -0
- package/dist/unified-provider/matching/database-sql-matcher.js.map +1 -0
- package/dist/unified-provider/matching/gorm-matcher.d.ts +41 -0
- package/dist/unified-provider/matching/gorm-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/gorm-matcher.js +222 -0
- package/dist/unified-provider/matching/gorm-matcher.js.map +1 -0
- package/dist/unified-provider/matching/index.d.ts +3 -0
- package/dist/unified-provider/matching/index.d.ts.map +1 -1
- package/dist/unified-provider/matching/index.js +4 -0
- package/dist/unified-provider/matching/index.js.map +1 -1
- package/dist/unified-provider/matching/matcher-registry.d.ts.map +1 -1
- package/dist/unified-provider/matching/matcher-registry.js +7 -0
- package/dist/unified-provider/matching/matcher-registry.js.map +1 -1
- package/dist/unified-provider/matching/sqlx-matcher.d.ts +40 -0
- package/dist/unified-provider/matching/sqlx-matcher.d.ts.map +1 -0
- package/dist/unified-provider/matching/sqlx-matcher.js +214 -0
- package/dist/unified-provider/matching/sqlx-matcher.js.map +1 -0
- package/dist/unified-provider/normalization/go-normalizer.d.ts +62 -0
- package/dist/unified-provider/normalization/go-normalizer.d.ts.map +1 -0
- package/dist/unified-provider/normalization/go-normalizer.js +608 -0
- package/dist/unified-provider/normalization/go-normalizer.js.map +1 -0
- package/dist/unified-provider/normalization/index.d.ts +1 -0
- package/dist/unified-provider/normalization/index.d.ts.map +1 -1
- package/dist/unified-provider/normalization/index.js +6 -1
- package/dist/unified-provider/normalization/index.js.map +1 -1
- package/dist/unified-provider/types.d.ts +1 -1
- package/dist/unified-provider/types.d.ts.map +1 -1
- package/dist/wpf/extractors/binding-error-detector.d.ts +75 -0
- package/dist/wpf/extractors/binding-error-detector.d.ts.map +1 -0
- package/dist/wpf/extractors/binding-error-detector.js +290 -0
- package/dist/wpf/extractors/binding-error-detector.js.map +1 -0
- package/dist/wpf/extractors/code-behind-linker.d.ts +70 -0
- package/dist/wpf/extractors/code-behind-linker.d.ts.map +1 -0
- package/dist/wpf/extractors/code-behind-linker.js +172 -0
- package/dist/wpf/extractors/code-behind-linker.js.map +1 -0
- package/dist/wpf/extractors/dependency-property-extractor.d.ts +61 -0
- package/dist/wpf/extractors/dependency-property-extractor.d.ts.map +1 -0
- package/dist/wpf/extractors/dependency-property-extractor.js +201 -0
- package/dist/wpf/extractors/dependency-property-extractor.js.map +1 -0
- package/dist/wpf/extractors/regex/viewmodel-regex.d.ts +82 -0
- package/dist/wpf/extractors/regex/viewmodel-regex.d.ts.map +1 -0
- package/dist/wpf/extractors/regex/viewmodel-regex.js +412 -0
- package/dist/wpf/extractors/regex/viewmodel-regex.js.map +1 -0
- package/dist/wpf/extractors/regex/xaml-regex.d.ts +77 -0
- package/dist/wpf/extractors/regex/xaml-regex.d.ts.map +1 -0
- package/dist/wpf/extractors/regex/xaml-regex.js +353 -0
- package/dist/wpf/extractors/regex/xaml-regex.js.map +1 -0
- package/dist/wpf/extractors/resource-dictionary-parser.d.ts +103 -0
- package/dist/wpf/extractors/resource-dictionary-parser.d.ts.map +1 -0
- package/dist/wpf/extractors/resource-dictionary-parser.js +296 -0
- package/dist/wpf/extractors/resource-dictionary-parser.js.map +1 -0
- package/dist/wpf/extractors/value-converter-extractor.d.ts +128 -0
- package/dist/wpf/extractors/value-converter-extractor.d.ts.map +1 -0
- package/dist/wpf/extractors/value-converter-extractor.js +312 -0
- package/dist/wpf/extractors/value-converter-extractor.js.map +1 -0
- package/dist/wpf/extractors/viewmodel-hybrid-extractor.d.ts +104 -0
- package/dist/wpf/extractors/viewmodel-hybrid-extractor.d.ts.map +1 -0
- package/dist/wpf/extractors/viewmodel-hybrid-extractor.js +513 -0
- package/dist/wpf/extractors/viewmodel-hybrid-extractor.js.map +1 -0
- package/dist/wpf/extractors/xaml-hybrid-extractor.d.ts +98 -0
- package/dist/wpf/extractors/xaml-hybrid-extractor.d.ts.map +1 -0
- package/dist/wpf/extractors/xaml-hybrid-extractor.js +444 -0
- package/dist/wpf/extractors/xaml-hybrid-extractor.js.map +1 -0
- package/dist/wpf/index.d.ts +25 -0
- package/dist/wpf/index.d.ts.map +1 -0
- package/dist/wpf/index.js +31 -0
- package/dist/wpf/index.js.map +1 -0
- package/dist/wpf/integration/wpf-callgraph-adapter.d.ts +82 -0
- package/dist/wpf/integration/wpf-callgraph-adapter.d.ts.map +1 -0
- package/dist/wpf/integration/wpf-callgraph-adapter.js +311 -0
- package/dist/wpf/integration/wpf-callgraph-adapter.js.map +1 -0
- package/dist/wpf/integration/wpf-data-flow-tracer.d.ts +129 -0
- package/dist/wpf/integration/wpf-data-flow-tracer.d.ts.map +1 -0
- package/dist/wpf/integration/wpf-data-flow-tracer.js +367 -0
- package/dist/wpf/integration/wpf-data-flow-tracer.js.map +1 -0
- package/dist/wpf/linkers/datacontext-resolver.d.ts +66 -0
- package/dist/wpf/linkers/datacontext-resolver.d.ts.map +1 -0
- package/dist/wpf/linkers/datacontext-resolver.js +240 -0
- package/dist/wpf/linkers/datacontext-resolver.js.map +1 -0
- package/dist/wpf/linkers/viewmodel-linker.d.ts +71 -0
- package/dist/wpf/linkers/viewmodel-linker.d.ts.map +1 -0
- package/dist/wpf/linkers/viewmodel-linker.js +268 -0
- package/dist/wpf/linkers/viewmodel-linker.js.map +1 -0
- package/dist/wpf/types.d.ts +451 -0
- package/dist/wpf/types.d.ts.map +1 -0
- package/dist/wpf/types.js +8 -0
- package/dist/wpf/types.js.map +1 -0
- package/dist/wpf/wpf-analyzer.d.ts +114 -0
- package/dist/wpf/wpf-analyzer.d.ts.map +1 -0
- package/dist/wpf/wpf-analyzer.js +332 -0
- package/dist/wpf/wpf-analyzer.js.map +1 -0
- package/dist/wrappers/integration/adapter.d.ts.map +1 -1
- package/dist/wrappers/integration/adapter.js +1 -0
- package/dist/wrappers/integration/adapter.js.map +1 -1
- package/package.json +29 -18
- package/LICENSE +0 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/call-graph/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAM9E;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,YAAY,GAAG,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/call-graph/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAM9E;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,YAAY,GAAG,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,IAAI,CAAC;AAE1G;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,aAAa,EAAE,MAAM,CAAC;IACtB,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe;IACf,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,+BAA+B;IAC/B,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,+CAA+C;IAC/C,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrB,8CAA8C;IAC9C,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,qCAAqC;IACrC,SA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;AACH,MAAM,WAAW,mBAAmB;IAClC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oBAAoB;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,6BAA6B;IAC7B,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KAC5B,CAAC;IACF,8CAA8C;IAC9C,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,4CAA4C;IAC5C,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,6CAA6C;IAC7C,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,0BAA0B;IAC1B,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,uBAAuB;IACvB,WAAW,EAAE,eAAe,CAAC;CAC9B"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constraint Synthesizer
|
|
3
|
+
*
|
|
4
|
+
* Converts detected invariants into full Constraint objects,
|
|
5
|
+
* handles deduplication, merging, and ID generation.
|
|
6
|
+
*/
|
|
7
|
+
import type { ExtractionResult, ExtractionOptions } from '../types.js';
|
|
8
|
+
import type { ConstraintStore } from '../store/constraint-store.js';
|
|
9
|
+
import type { InvariantDetector } from './invariant-detector.js';
|
|
10
|
+
export interface ConstraintSynthesizerConfig {
|
|
11
|
+
store: ConstraintStore;
|
|
12
|
+
detector: InvariantDetector;
|
|
13
|
+
}
|
|
14
|
+
export interface SynthesisOptions extends ExtractionOptions {
|
|
15
|
+
/** Auto-approve constraints above this confidence */
|
|
16
|
+
autoApproveThreshold?: number;
|
|
17
|
+
/** Merge similar constraints */
|
|
18
|
+
mergeSimilar?: boolean;
|
|
19
|
+
/** Similarity threshold for merging (0-1) */
|
|
20
|
+
similarityThreshold?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare class ConstraintSynthesizer {
|
|
23
|
+
private readonly store;
|
|
24
|
+
private readonly detector;
|
|
25
|
+
constructor(config: ConstraintSynthesizerConfig);
|
|
26
|
+
/**
|
|
27
|
+
* Extract and synthesize constraints from the codebase
|
|
28
|
+
*/
|
|
29
|
+
synthesize(options?: SynthesisOptions): Promise<ExtractionResult>;
|
|
30
|
+
/**
|
|
31
|
+
* Convert a detected invariant to a full Constraint
|
|
32
|
+
*/
|
|
33
|
+
private toConstraint;
|
|
34
|
+
/**
|
|
35
|
+
* Generate a deterministic ID for a constraint
|
|
36
|
+
*/
|
|
37
|
+
private generateConstraintId;
|
|
38
|
+
/**
|
|
39
|
+
* Generate tags for a constraint
|
|
40
|
+
*/
|
|
41
|
+
private generateTags;
|
|
42
|
+
/**
|
|
43
|
+
* Merge similar constraints
|
|
44
|
+
*/
|
|
45
|
+
private mergeSimilarConstraints;
|
|
46
|
+
/**
|
|
47
|
+
* Check if two constraints are similar
|
|
48
|
+
*/
|
|
49
|
+
private areSimilar;
|
|
50
|
+
/**
|
|
51
|
+
* Calculate string similarity (Jaccard index on words)
|
|
52
|
+
*/
|
|
53
|
+
private stringSimilarity;
|
|
54
|
+
/**
|
|
55
|
+
* Merge multiple similar constraints into one
|
|
56
|
+
*/
|
|
57
|
+
private mergeConstraints;
|
|
58
|
+
/**
|
|
59
|
+
* Diff new constraints against existing ones
|
|
60
|
+
*/
|
|
61
|
+
private diffConstraints;
|
|
62
|
+
/**
|
|
63
|
+
* Check if a constraint has meaningfully changed
|
|
64
|
+
*/
|
|
65
|
+
private hasChanged;
|
|
66
|
+
/**
|
|
67
|
+
* Build extraction statistics
|
|
68
|
+
*/
|
|
69
|
+
private buildStats;
|
|
70
|
+
}
|
|
71
|
+
export declare function createConstraintSynthesizer(config: ConstraintSynthesizerConfig): ConstraintSynthesizer;
|
|
72
|
+
//# sourceMappingURL=constraint-synthesizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constraint-synthesizer.d.ts","sourceRoot":"","sources":["../../../src/constraints/extraction/constraint-synthesizer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAIV,gBAAgB,EAEhB,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAGrB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAqB,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAMpF,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,qDAAqD;IACrD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gCAAgC;IAChC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,6CAA6C;IAC7C,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAMD,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;IACxC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoB;gBAEjC,MAAM,EAAE,2BAA2B;IAK/C;;OAEG;IACG,UAAU,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA2C3E;;OAEG;IACH,OAAO,CAAC,YAAY;IAoCpB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAY5B;;OAEG;IACH,OAAO,CAAC,YAAY;IAqCpB;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAyC/B;;OAEG;IACH,OAAO,CAAC,UAAU;IAoBlB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAUxB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IA2DxB;;OAEG;IACH,OAAO,CAAC,eAAe;IAsDvB;;OAEG;IACH,OAAO,CAAC,UAAU;IAgBlB;;OAEG;IACH,OAAO,CAAC,UAAU;CAyBnB;AAMD,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,2BAA2B,GAClC,qBAAqB,CAEvB"}
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constraint Synthesizer
|
|
3
|
+
*
|
|
4
|
+
* Converts detected invariants into full Constraint objects,
|
|
5
|
+
* handles deduplication, merging, and ID generation.
|
|
6
|
+
*/
|
|
7
|
+
import { createHash } from 'node:crypto';
|
|
8
|
+
import { CONSTRAINT_SCHEMA_VERSION as SCHEMA_VERSION } from '../types.js';
|
|
9
|
+
// =============================================================================
|
|
10
|
+
// Constraint Synthesizer
|
|
11
|
+
// =============================================================================
|
|
12
|
+
export class ConstraintSynthesizer {
|
|
13
|
+
store;
|
|
14
|
+
detector;
|
|
15
|
+
constructor(config) {
|
|
16
|
+
this.store = config.store;
|
|
17
|
+
this.detector = config.detector;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Extract and synthesize constraints from the codebase
|
|
21
|
+
*/
|
|
22
|
+
async synthesize(options = {}) {
|
|
23
|
+
const startTime = Date.now();
|
|
24
|
+
// Detect invariants
|
|
25
|
+
const invariants = await this.detector.detectAll(options);
|
|
26
|
+
// Convert to constraints
|
|
27
|
+
const constraints = invariants.map(inv => this.toConstraint(inv, options));
|
|
28
|
+
// Merge similar constraints if enabled
|
|
29
|
+
const merged = options.mergeSimilar !== false
|
|
30
|
+
? this.mergeSimilarConstraints(constraints, options.similarityThreshold ?? 0.8)
|
|
31
|
+
: constraints;
|
|
32
|
+
// Compare with existing constraints
|
|
33
|
+
const existing = this.store.getAll();
|
|
34
|
+
const { discovered, updated, invalidated } = this.diffConstraints(merged, existing);
|
|
35
|
+
// Save new and updated constraints
|
|
36
|
+
if (discovered.length > 0) {
|
|
37
|
+
await this.store.addMany(discovered);
|
|
38
|
+
}
|
|
39
|
+
for (const constraint of updated) {
|
|
40
|
+
await this.store.update(constraint.id, constraint);
|
|
41
|
+
}
|
|
42
|
+
// Mark invalidated constraints
|
|
43
|
+
for (const id of invalidated) {
|
|
44
|
+
await this.store.ignore(id, 'No longer detected in codebase');
|
|
45
|
+
}
|
|
46
|
+
// Build stats
|
|
47
|
+
const stats = this.buildStats(discovered, updated, invalidated, startTime);
|
|
48
|
+
return {
|
|
49
|
+
discovered,
|
|
50
|
+
updated,
|
|
51
|
+
invalidated,
|
|
52
|
+
stats,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Convert a detected invariant to a full Constraint
|
|
57
|
+
*/
|
|
58
|
+
toConstraint(invariant, options) {
|
|
59
|
+
const now = new Date().toISOString();
|
|
60
|
+
// Generate deterministic ID based on constraint content
|
|
61
|
+
const id = this.generateConstraintId(invariant);
|
|
62
|
+
// Determine status based on confidence
|
|
63
|
+
let status = 'discovered';
|
|
64
|
+
if (options.autoApproveThreshold !== undefined &&
|
|
65
|
+
invariant.constraint.confidence.score >= options.autoApproveThreshold) {
|
|
66
|
+
status = 'approved';
|
|
67
|
+
}
|
|
68
|
+
const metadata = {
|
|
69
|
+
createdAt: now,
|
|
70
|
+
updatedAt: now,
|
|
71
|
+
schemaVersion: SCHEMA_VERSION,
|
|
72
|
+
tags: this.generateTags(invariant),
|
|
73
|
+
};
|
|
74
|
+
if (status === 'approved') {
|
|
75
|
+
metadata.approvedBy = 'auto';
|
|
76
|
+
metadata.approvedAt = now;
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
...invariant.constraint,
|
|
80
|
+
id,
|
|
81
|
+
status,
|
|
82
|
+
metadata,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Generate a deterministic ID for a constraint
|
|
87
|
+
*/
|
|
88
|
+
generateConstraintId(invariant) {
|
|
89
|
+
const content = JSON.stringify({
|
|
90
|
+
name: invariant.constraint.name,
|
|
91
|
+
category: invariant.constraint.category,
|
|
92
|
+
type: invariant.constraint.invariant.type,
|
|
93
|
+
condition: invariant.constraint.invariant.condition,
|
|
94
|
+
});
|
|
95
|
+
const hash = createHash('sha256').update(content).digest('hex').slice(0, 12);
|
|
96
|
+
return `constraint-${invariant.constraint.category}-${hash}`;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Generate tags for a constraint
|
|
100
|
+
*/
|
|
101
|
+
generateTags(invariant) {
|
|
102
|
+
const tags = [];
|
|
103
|
+
// Add source tags
|
|
104
|
+
if (invariant.evidence.sources.includes('callGraph')) {
|
|
105
|
+
tags.push('call-graph-derived');
|
|
106
|
+
}
|
|
107
|
+
if (invariant.evidence.sources.some(s => s.startsWith('pattern:'))) {
|
|
108
|
+
tags.push('pattern-derived');
|
|
109
|
+
}
|
|
110
|
+
if (invariant.evidence.sources.includes('boundaries')) {
|
|
111
|
+
tags.push('boundary-derived');
|
|
112
|
+
}
|
|
113
|
+
if (invariant.evidence.sources.includes('testTopology')) {
|
|
114
|
+
tags.push('test-derived');
|
|
115
|
+
}
|
|
116
|
+
if (invariant.evidence.sources.includes('errorHandling')) {
|
|
117
|
+
tags.push('error-handling-derived');
|
|
118
|
+
}
|
|
119
|
+
// Add confidence tags
|
|
120
|
+
if (invariant.constraint.confidence.score >= 0.95) {
|
|
121
|
+
tags.push('high-confidence');
|
|
122
|
+
}
|
|
123
|
+
else if (invariant.constraint.confidence.score >= 0.85) {
|
|
124
|
+
tags.push('medium-confidence');
|
|
125
|
+
}
|
|
126
|
+
// Add violation tags
|
|
127
|
+
if (invariant.violations.length === 0) {
|
|
128
|
+
tags.push('no-violations');
|
|
129
|
+
}
|
|
130
|
+
else if (invariant.violations.length > 10) {
|
|
131
|
+
tags.push('many-violations');
|
|
132
|
+
}
|
|
133
|
+
return tags;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Merge similar constraints
|
|
137
|
+
*/
|
|
138
|
+
mergeSimilarConstraints(constraints, threshold) {
|
|
139
|
+
const merged = [];
|
|
140
|
+
const used = new Set();
|
|
141
|
+
for (let i = 0; i < constraints.length; i++) {
|
|
142
|
+
if (used.has(i))
|
|
143
|
+
continue;
|
|
144
|
+
const current = constraints[i];
|
|
145
|
+
if (!current)
|
|
146
|
+
continue;
|
|
147
|
+
const similar = [current];
|
|
148
|
+
// Find similar constraints
|
|
149
|
+
for (let j = i + 1; j < constraints.length; j++) {
|
|
150
|
+
if (used.has(j))
|
|
151
|
+
continue;
|
|
152
|
+
const other = constraints[j];
|
|
153
|
+
if (!other)
|
|
154
|
+
continue;
|
|
155
|
+
if (this.areSimilar(current, other, threshold)) {
|
|
156
|
+
similar.push(other);
|
|
157
|
+
used.add(j);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
// Merge if multiple similar found
|
|
161
|
+
if (similar.length > 1) {
|
|
162
|
+
merged.push(this.mergeConstraints(similar));
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
merged.push(current);
|
|
166
|
+
}
|
|
167
|
+
used.add(i);
|
|
168
|
+
}
|
|
169
|
+
return merged;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Check if two constraints are similar
|
|
173
|
+
*/
|
|
174
|
+
areSimilar(a, b, threshold) {
|
|
175
|
+
// Must be same category
|
|
176
|
+
if (a.category !== b.category)
|
|
177
|
+
return false;
|
|
178
|
+
// Must be same type
|
|
179
|
+
if (a.invariant.type !== b.invariant.type)
|
|
180
|
+
return false;
|
|
181
|
+
// Check name similarity
|
|
182
|
+
const nameSimilarity = this.stringSimilarity(a.name, b.name);
|
|
183
|
+
if (nameSimilarity < threshold)
|
|
184
|
+
return false;
|
|
185
|
+
// Check condition similarity
|
|
186
|
+
const conditionSimilarity = this.stringSimilarity(a.invariant.condition, b.invariant.condition);
|
|
187
|
+
return conditionSimilarity >= threshold;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Calculate string similarity (Jaccard index on words)
|
|
191
|
+
*/
|
|
192
|
+
stringSimilarity(a, b) {
|
|
193
|
+
const wordsA = new Set(a.toLowerCase().split(/\s+/));
|
|
194
|
+
const wordsB = new Set(b.toLowerCase().split(/\s+/));
|
|
195
|
+
const intersection = new Set([...wordsA].filter(w => wordsB.has(w)));
|
|
196
|
+
const union = new Set([...wordsA, ...wordsB]);
|
|
197
|
+
return intersection.size / union.size;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Merge multiple similar constraints into one
|
|
201
|
+
*/
|
|
202
|
+
mergeConstraints(constraints) {
|
|
203
|
+
// Use the one with highest confidence as base
|
|
204
|
+
const sorted = [...constraints].sort((a, b) => b.confidence.score - a.confidence.score);
|
|
205
|
+
const base = sorted[0];
|
|
206
|
+
if (!base) {
|
|
207
|
+
throw new Error('Cannot merge empty constraint array');
|
|
208
|
+
}
|
|
209
|
+
// Merge evidence
|
|
210
|
+
const totalEvidence = constraints.reduce((sum, c) => sum + c.confidence.evidence, 0);
|
|
211
|
+
const totalViolations = constraints.reduce((sum, c) => sum + c.confidence.violations, 0);
|
|
212
|
+
// Merge sources
|
|
213
|
+
const allPatterns = new Set();
|
|
214
|
+
const allCallGraphPaths = new Set();
|
|
215
|
+
const allBoundaries = new Set();
|
|
216
|
+
for (const c of constraints) {
|
|
217
|
+
c.derivedFrom.patterns.forEach(p => allPatterns.add(p));
|
|
218
|
+
c.derivedFrom.callGraphPaths.forEach(p => allCallGraphPaths.add(p));
|
|
219
|
+
c.derivedFrom.boundaries.forEach(b => allBoundaries.add(b));
|
|
220
|
+
}
|
|
221
|
+
// Merge tags
|
|
222
|
+
const allTags = new Set();
|
|
223
|
+
for (const c of constraints) {
|
|
224
|
+
c.metadata.tags?.forEach(t => allTags.add(t));
|
|
225
|
+
}
|
|
226
|
+
return {
|
|
227
|
+
...base,
|
|
228
|
+
derivedFrom: {
|
|
229
|
+
patterns: Array.from(allPatterns),
|
|
230
|
+
callGraphPaths: Array.from(allCallGraphPaths),
|
|
231
|
+
boundaries: Array.from(allBoundaries),
|
|
232
|
+
},
|
|
233
|
+
confidence: {
|
|
234
|
+
...base.confidence,
|
|
235
|
+
evidence: totalEvidence,
|
|
236
|
+
violations: totalViolations,
|
|
237
|
+
score: totalEvidence / (totalEvidence + totalViolations),
|
|
238
|
+
},
|
|
239
|
+
metadata: {
|
|
240
|
+
...base.metadata,
|
|
241
|
+
tags: Array.from(allTags),
|
|
242
|
+
notes: `Merged from ${constraints.length} similar constraints`,
|
|
243
|
+
},
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Diff new constraints against existing ones
|
|
248
|
+
*/
|
|
249
|
+
diffConstraints(newConstraints, existing) {
|
|
250
|
+
const discovered = [];
|
|
251
|
+
const updated = [];
|
|
252
|
+
const invalidated = [];
|
|
253
|
+
const existingById = new Map(existing.map(c => [c.id, c]));
|
|
254
|
+
const newById = new Map(newConstraints.map(c => [c.id, c]));
|
|
255
|
+
// Find new and updated
|
|
256
|
+
for (const constraint of newConstraints) {
|
|
257
|
+
const existingConstraint = existingById.get(constraint.id);
|
|
258
|
+
if (!existingConstraint) {
|
|
259
|
+
discovered.push(constraint);
|
|
260
|
+
}
|
|
261
|
+
else if (this.hasChanged(constraint, existingConstraint)) {
|
|
262
|
+
// Preserve status and approval info
|
|
263
|
+
const updatedMetadata = {
|
|
264
|
+
...constraint.metadata,
|
|
265
|
+
createdAt: existingConstraint.metadata.createdAt,
|
|
266
|
+
};
|
|
267
|
+
if (existingConstraint.metadata.approvedBy) {
|
|
268
|
+
updatedMetadata.approvedBy = existingConstraint.metadata.approvedBy;
|
|
269
|
+
}
|
|
270
|
+
if (existingConstraint.metadata.approvedAt) {
|
|
271
|
+
updatedMetadata.approvedAt = existingConstraint.metadata.approvedAt;
|
|
272
|
+
}
|
|
273
|
+
updated.push({
|
|
274
|
+
...constraint,
|
|
275
|
+
status: existingConstraint.status,
|
|
276
|
+
metadata: updatedMetadata,
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
// Find invalidated (existing but not in new, and not custom)
|
|
281
|
+
for (const existing of existingById.values()) {
|
|
282
|
+
if (!newById.has(existing.id) &&
|
|
283
|
+
existing.status !== 'custom' &&
|
|
284
|
+
existing.status !== 'ignored') {
|
|
285
|
+
invalidated.push(existing.id);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return { discovered, updated, invalidated };
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Check if a constraint has meaningfully changed
|
|
292
|
+
*/
|
|
293
|
+
hasChanged(newC, oldC) {
|
|
294
|
+
// Check confidence change
|
|
295
|
+
const confidenceDelta = Math.abs(newC.confidence.score - oldC.confidence.score);
|
|
296
|
+
if (confidenceDelta > 0.05)
|
|
297
|
+
return true;
|
|
298
|
+
// Check evidence change
|
|
299
|
+
const evidenceDelta = Math.abs(newC.confidence.evidence - oldC.confidence.evidence);
|
|
300
|
+
if (evidenceDelta > 5)
|
|
301
|
+
return true;
|
|
302
|
+
// Check violation change
|
|
303
|
+
const violationDelta = Math.abs(newC.confidence.violations - oldC.confidence.violations);
|
|
304
|
+
if (violationDelta > 3)
|
|
305
|
+
return true;
|
|
306
|
+
return false;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Build extraction statistics
|
|
310
|
+
*/
|
|
311
|
+
buildStats(discovered, updated, invalidated, startTime) {
|
|
312
|
+
const byCategory = {};
|
|
313
|
+
const byLanguage = {};
|
|
314
|
+
for (const c of [...discovered, ...updated]) {
|
|
315
|
+
byCategory[c.category] = (byCategory[c.category] ?? 0) + 1;
|
|
316
|
+
byLanguage[c.language] = (byLanguage[c.language] ?? 0) + 1;
|
|
317
|
+
}
|
|
318
|
+
return {
|
|
319
|
+
patternsAnalyzed: 0, // Would need to track this in detector
|
|
320
|
+
candidatesFound: discovered.length + updated.length,
|
|
321
|
+
constraintsCreated: discovered.length,
|
|
322
|
+
constraintsUpdated: updated.length,
|
|
323
|
+
constraintsInvalidated: invalidated.length,
|
|
324
|
+
executionTimeMs: Date.now() - startTime,
|
|
325
|
+
byCategory: byCategory,
|
|
326
|
+
byLanguage: byLanguage,
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
// =============================================================================
|
|
331
|
+
// Factory
|
|
332
|
+
// =============================================================================
|
|
333
|
+
export function createConstraintSynthesizer(config) {
|
|
334
|
+
return new ConstraintSynthesizer(config);
|
|
335
|
+
}
|
|
336
|
+
//# sourceMappingURL=constraint-synthesizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constraint-synthesizer.js","sourceRoot":"","sources":["../../../src/constraints/extraction/constraint-synthesizer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAWzC,OAAO,EAAE,yBAAyB,IAAI,cAAc,EAAE,MAAM,aAAa,CAAC;AAsB1E,gFAAgF;AAChF,yBAAyB;AACzB,gFAAgF;AAEhF,MAAM,OAAO,qBAAqB;IACf,KAAK,CAAkB;IACvB,QAAQ,CAAoB;IAE7C,YAAY,MAAmC;QAC7C,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU,CAAC,UAA4B,EAAE;QAC7C,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE7B,oBAAoB;QACpB,MAAM,UAAU,GAAG,MAAM,IAAI,C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
* Constraint Extraction Module
|
|
3
|
+
*
|
|
4
|
+
* Detects and synthesizes architectural constraints from Drift's analysis data.
|
|
5
|
+
*/
|
|
6
|
+
export { InvariantDetector, createInvariantDetector, } from './invariant-detector.js';
|
|
7
|
+
export type { InvariantDetectorConfig, DetectedInvariant, InvariantEvidence, } from './invariant-detector.js';
|
|
8
|
+
export { ConstraintSynthesizer, createConstraintSynthesizer, } from './constraint-synthesizer.js';
|
|
9
|
+
export type { ConstraintSynthesizerConfig, SynthesisOptions, } from './constraint-synthesizer.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constraints/extraction/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,2BAA2B,EAC3B,gBAAgB,GACjB,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constraint Extraction Module
|
|
3
|
+
*
|
|
4
|
+
* Detects and synthesizes architectural constraints from Drift's analysis data.
|
|
5
|
+
*/
|
|
6
|
+
// Invariant Detector
|
|
7
|
+
export { InvariantDetector, createInvariantDetector, } from './invariant-detector.js';
|
|
8
|
+
// Constraint Synthesizer
|
|
9
|
+
export { ConstraintSynthesizer, createConstraintSynthesizer, } from './constraint-synthesizer.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constraints/extraction/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,qBAAqB;AACrB,OAAO,EACL,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AAOjC,yBAAyB;AACzB,OAAO,EACL,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Invariant Detector
|
|
3
|
+
*
|
|
4
|
+
* Analyzes Drift's existing data (patterns, call graphs, boundaries, test topology,
|
|
5
|
+
* error handling) to discover architectural invariants that can become constraints.
|
|
6
|
+
*
|
|
7
|
+
* This is the semantic analysis layer that mines invariants from:
|
|
8
|
+
* - Pattern data (high-confidence approved patterns)
|
|
9
|
+
* - Call graph (auth-before-data-access, validation patterns)
|
|
10
|
+
* - Boundaries (data access layer invariants)
|
|
11
|
+
* - Test topology (coverage requirements)
|
|
12
|
+
* - Error handling (error boundary patterns)
|
|
13
|
+
*/
|
|
14
|
+
import type { Constraint, ConstraintViolationDetail, ExtractionOptions } from '../types.js';
|
|
15
|
+
import type { PatternStore } from '../../store/pattern-store.js';
|
|
16
|
+
import type { CallGraphStore } from '../../call-graph/store/call-graph-store.js';
|
|
17
|
+
import type { BoundaryStore } from '../../boundaries/boundary-store.js';
|
|
18
|
+
import type { TestTopologyAnalyzer } from '../../test-topology/test-topology-analyzer.js';
|
|
19
|
+
import type { ErrorHandlingAnalyzer } from '../../error-handling/error-handling-analyzer.js';
|
|
20
|
+
export interface InvariantDetectorConfig {
|
|
21
|
+
rootDir: string;
|
|
22
|
+
patternStore?: PatternStore;
|
|
23
|
+
callGraphStore?: CallGraphStore;
|
|
24
|
+
boundaryStore?: BoundaryStore;
|
|
25
|
+
testTopologyAnalyzer?: TestTopologyAnalyzer;
|
|
26
|
+
errorHandlingAnalyzer?: ErrorHandlingAnalyzer;
|
|
27
|
+
}
|
|
28
|
+
export interface DetectedInvariant {
|
|
29
|
+
/** Proposed constraint */
|
|
30
|
+
constraint: Omit<Constraint, 'id' | 'metadata'>;
|
|
31
|
+
/** Evidence supporting this invariant */
|
|
32
|
+
evidence: InvariantEvidence;
|
|
33
|
+
/** Violations found during detection */
|
|
34
|
+
violations: ConstraintViolationDetail[];
|
|
35
|
+
}
|
|
36
|
+
export interface InvariantEvidence {
|
|
37
|
+
/** Number of conforming instances */
|
|
38
|
+
conforming: number;
|
|
39
|
+
/** Number of violating instances */
|
|
40
|
+
violating: number;
|
|
41
|
+
/** Sample locations that conform */
|
|
42
|
+
conformingLocations: string[];
|
|
43
|
+
/** Sample locations that violate */
|
|
44
|
+
violatingLocations: string[];
|
|
45
|
+
/** Source data used */
|
|
46
|
+
sources: string[];
|
|
47
|
+
}
|
|
48
|
+
export declare class InvariantDetector {
|
|
49
|
+
private readonly config;
|
|
50
|
+
constructor(config: InvariantDetectorConfig);
|
|
51
|
+
/**
|
|
52
|
+
* Detect invariants from all available Drift data
|
|
53
|
+
*/
|
|
54
|
+
detectAll(options?: ExtractionOptions): Promise<DetectedInvariant[]>;
|
|
55
|
+
/**
|
|
56
|
+
* Detect invariants from pattern data
|
|
57
|
+
*/
|
|
58
|
+
private detectFromPatterns;
|
|
59
|
+
/**
|
|
60
|
+
* Convert a high-confidence pattern to an invariant
|
|
61
|
+
*/
|
|
62
|
+
private patternToInvariant;
|
|
63
|
+
/**
|
|
64
|
+
* Detect invariants from call graph analysis
|
|
65
|
+
*/
|
|
66
|
+
private detectFromCallGraph;
|
|
67
|
+
/**
|
|
68
|
+
* Detect auth-before-data-access patterns
|
|
69
|
+
*/
|
|
70
|
+
private detectAuthBeforeDataAccess;
|
|
71
|
+
/**
|
|
72
|
+
* Check if a function has auth in its call chain
|
|
73
|
+
*/
|
|
74
|
+
private hasAuthInCallChain;
|
|
75
|
+
/**
|
|
76
|
+
* Detect validation patterns in call graph
|
|
77
|
+
*/
|
|
78
|
+
private detectValidationPatterns;
|
|
79
|
+
/**
|
|
80
|
+
* Check if a function has a pattern in its call chain
|
|
81
|
+
*/
|
|
82
|
+
private hasPatternInCallChain;
|
|
83
|
+
/**
|
|
84
|
+
* Detect invariants from boundary data
|
|
85
|
+
*/
|
|
86
|
+
private detectFromBoundaries;
|
|
87
|
+
/**
|
|
88
|
+
* Detect invariants for sensitive data access
|
|
89
|
+
*/
|
|
90
|
+
private detectSensitiveDataInvariants;
|
|
91
|
+
/**
|
|
92
|
+
* Extract the access layer from an accessor context
|
|
93
|
+
*/
|
|
94
|
+
private extractAccessLayer;
|
|
95
|
+
/**
|
|
96
|
+
* Detect invariants from test topology
|
|
97
|
+
*/
|
|
98
|
+
private detectFromTestTopology;
|
|
99
|
+
/**
|
|
100
|
+
* Detect invariants from error handling analysis
|
|
101
|
+
*/
|
|
102
|
+
private detectFromErrorHandling;
|
|
103
|
+
private detectLanguageFromPattern;
|
|
104
|
+
private buildPredicateFromPattern;
|
|
105
|
+
private inferConstraintType;
|
|
106
|
+
private buildScopeFromPattern;
|
|
107
|
+
}
|
|
108
|
+
export declare function createInvariantDetector(config: InvariantDetectorConfig): InvariantDetector;
|
|
109
|
+
//# sourceMappingURL=invariant-detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invariant-detector.d.ts","sourceRoot":"","sources":["../../../src/constraints/extraction/invariant-detector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EACV,UAAU,EAKV,yBAAyB,EAEzB,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAEjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AAM7F,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAA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