opencode-telos 1.0.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 +927 -0
- package/dist/code-intelligence/analyzer.d.ts +9 -0
- package/dist/code-intelligence/analyzer.d.ts.map +1 -0
- package/dist/code-intelligence/analyzer.js +321 -0
- package/dist/code-intelligence/analyzer.js.map +1 -0
- package/dist/code-intelligence/ast/cache.d.ts +16 -0
- package/dist/code-intelligence/ast/cache.d.ts.map +1 -0
- package/dist/code-intelligence/ast/cache.js +44 -0
- package/dist/code-intelligence/ast/cache.js.map +1 -0
- package/dist/code-intelligence/ast/common.d.ts +8 -0
- package/dist/code-intelligence/ast/common.d.ts.map +1 -0
- package/dist/code-intelligence/ast/common.js +42 -0
- package/dist/code-intelligence/ast/common.js.map +1 -0
- package/dist/code-intelligence/ast/component.d.ts +10 -0
- package/dist/code-intelligence/ast/component.d.ts.map +1 -0
- package/dist/code-intelligence/ast/component.js +38 -0
- package/dist/code-intelligence/ast/component.js.map +1 -0
- package/dist/code-intelligence/ast/fallback.d.ts +9 -0
- package/dist/code-intelligence/ast/fallback.d.ts.map +1 -0
- package/dist/code-intelligence/ast/fallback.js +38 -0
- package/dist/code-intelligence/ast/fallback.js.map +1 -0
- package/dist/code-intelligence/ast/index.d.ts +5 -0
- package/dist/code-intelligence/ast/index.d.ts.map +1 -0
- package/dist/code-intelligence/ast/index.js +5 -0
- package/dist/code-intelligence/ast/index.js.map +1 -0
- package/dist/code-intelligence/ast/ir.d.ts +72 -0
- package/dist/code-intelligence/ast/ir.d.ts.map +1 -0
- package/dist/code-intelligence/ast/ir.js +2 -0
- package/dist/code-intelligence/ast/ir.js.map +1 -0
- package/dist/code-intelligence/ast/metrics.d.ts +25 -0
- package/dist/code-intelligence/ast/metrics.d.ts.map +1 -0
- package/dist/code-intelligence/ast/metrics.js +38 -0
- package/dist/code-intelligence/ast/metrics.js.map +1 -0
- package/dist/code-intelligence/ast/registry.d.ts +5 -0
- package/dist/code-intelligence/ast/registry.d.ts.map +1 -0
- package/dist/code-intelligence/ast/registry.js +22 -0
- package/dist/code-intelligence/ast/registry.js.map +1 -0
- package/dist/code-intelligence/ast/tree-sitter.d.ts +8 -0
- package/dist/code-intelligence/ast/tree-sitter.d.ts.map +1 -0
- package/dist/code-intelligence/ast/tree-sitter.js +247 -0
- package/dist/code-intelligence/ast/tree-sitter.js.map +1 -0
- package/dist/code-intelligence/ast/typescript.d.ts +8 -0
- package/dist/code-intelligence/ast/typescript.d.ts.map +1 -0
- package/dist/code-intelligence/ast/typescript.js +147 -0
- package/dist/code-intelligence/ast/typescript.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/server.d.ts +27 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +67 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/opencode/hooks.d.ts +9 -0
- package/dist/opencode/hooks.d.ts.map +1 -0
- package/dist/opencode/hooks.js +583 -0
- package/dist/opencode/hooks.js.map +1 -0
- package/dist/opencode/router/categories.d.ts +31 -0
- package/dist/opencode/router/categories.d.ts.map +1 -0
- package/dist/opencode/router/categories.js +165 -0
- package/dist/opencode/router/categories.js.map +1 -0
- package/dist/opencode/router/embeddings.d.ts +41 -0
- package/dist/opencode/router/embeddings.d.ts.map +1 -0
- package/dist/opencode/router/embeddings.js +136 -0
- package/dist/opencode/router/embeddings.js.map +1 -0
- package/dist/opencode/router/graph-state-snapshot.d.ts +35 -0
- package/dist/opencode/router/graph-state-snapshot.d.ts.map +1 -0
- package/dist/opencode/router/graph-state-snapshot.js +129 -0
- package/dist/opencode/router/graph-state-snapshot.js.map +1 -0
- package/dist/opencode/router/index.d.ts +21 -0
- package/dist/opencode/router/index.d.ts.map +1 -0
- package/dist/opencode/router/index.js +23 -0
- package/dist/opencode/router/index.js.map +1 -0
- package/dist/opencode/router/intent-classifier.d.ts +35 -0
- package/dist/opencode/router/intent-classifier.d.ts.map +1 -0
- package/dist/opencode/router/intent-classifier.js +108 -0
- package/dist/opencode/router/intent-classifier.js.map +1 -0
- package/dist/opencode/router/semantic-nudge.d.ts +42 -0
- package/dist/opencode/router/semantic-nudge.d.ts.map +1 -0
- package/dist/opencode/router/semantic-nudge.js +73 -0
- package/dist/opencode/router/semantic-nudge.js.map +1 -0
- package/dist/opencode/router/state-gate.d.ts +25 -0
- package/dist/opencode/router/state-gate.d.ts.map +1 -0
- package/dist/opencode/router/state-gate.js +178 -0
- package/dist/opencode/router/state-gate.js.map +1 -0
- package/dist/opencode/router/tool-embeddings.d.ts +36 -0
- package/dist/opencode/router/tool-embeddings.d.ts.map +1 -0
- package/dist/opencode/router/tool-embeddings.js +140 -0
- package/dist/opencode/router/tool-embeddings.js.map +1 -0
- package/dist/opencode/router/tool-registry.d.ts +45 -0
- package/dist/opencode/router/tool-registry.d.ts.map +1 -0
- package/dist/opencode/router/tool-registry.js +103 -0
- package/dist/opencode/router/tool-registry.js.map +1 -0
- package/dist/opencode/router/tool-taxonomy.d.ts +51 -0
- package/dist/opencode/router/tool-taxonomy.d.ts.map +1 -0
- package/dist/opencode/router/tool-taxonomy.js +250 -0
- package/dist/opencode/router/tool-taxonomy.js.map +1 -0
- package/dist/opencode/router/tools-composite.d.ts +21 -0
- package/dist/opencode/router/tools-composite.d.ts.map +1 -0
- package/dist/opencode/router/tools-composite.js +684 -0
- package/dist/opencode/router/tools-composite.js.map +1 -0
- package/dist/opencode/shell-hooks.d.ts +7 -0
- package/dist/opencode/shell-hooks.d.ts.map +1 -0
- package/dist/opencode/shell-hooks.js +96 -0
- package/dist/opencode/shell-hooks.js.map +1 -0
- package/dist/opencode/system-prompt.d.ts +10 -0
- package/dist/opencode/system-prompt.d.ts.map +1 -0
- package/dist/opencode/system-prompt.js +600 -0
- package/dist/opencode/system-prompt.js.map +1 -0
- package/dist/opencode/tools.d.ts +8 -0
- package/dist/opencode/tools.d.ts.map +1 -0
- package/dist/opencode/tools.js +3731 -0
- package/dist/opencode/tools.js.map +1 -0
- package/dist/opencode/workflows/chains.d.ts +52 -0
- package/dist/opencode/workflows/chains.d.ts.map +1 -0
- package/dist/opencode/workflows/chains.js +170 -0
- package/dist/opencode/workflows/chains.js.map +1 -0
- package/dist/opencode/workflows/executor.d.ts +52 -0
- package/dist/opencode/workflows/executor.d.ts.map +1 -0
- package/dist/opencode/workflows/executor.js +130 -0
- package/dist/opencode/workflows/executor.js.map +1 -0
- package/dist/opencode/workflows/index.d.ts +14 -0
- package/dist/opencode/workflows/index.d.ts.map +1 -0
- package/dist/opencode/workflows/index.js +15 -0
- package/dist/opencode/workflows/index.js.map +1 -0
- package/dist/opencode/workflows/tools-workflow.d.ts +24 -0
- package/dist/opencode/workflows/tools-workflow.d.ts.map +1 -0
- package/dist/opencode/workflows/tools-workflow.js +85 -0
- package/dist/opencode/workflows/tools-workflow.js.map +1 -0
- package/dist/opencode/workflows/types.d.ts +32 -0
- package/dist/opencode/workflows/types.d.ts.map +1 -0
- package/dist/opencode/workflows/types.js +13 -0
- package/dist/opencode/workflows/types.js.map +1 -0
- package/dist/sdd/analysis/compliance.d.ts +30 -0
- package/dist/sdd/analysis/compliance.d.ts.map +1 -0
- package/dist/sdd/analysis/compliance.js +251 -0
- package/dist/sdd/analysis/compliance.js.map +1 -0
- package/dist/sdd/analysis/scalability.d.ts +15 -0
- package/dist/sdd/analysis/scalability.d.ts.map +1 -0
- package/dist/sdd/analysis/scalability.js +72 -0
- package/dist/sdd/analysis/scalability.js.map +1 -0
- package/dist/sdd/analysis/security.d.ts +25 -0
- package/dist/sdd/analysis/security.d.ts.map +1 -0
- package/dist/sdd/analysis/security.js +94 -0
- package/dist/sdd/analysis/security.js.map +1 -0
- package/dist/sdd/brownfield/scanner.d.ts +31 -0
- package/dist/sdd/brownfield/scanner.d.ts.map +1 -0
- package/dist/sdd/brownfield/scanner.js +228 -0
- package/dist/sdd/brownfield/scanner.js.map +1 -0
- package/dist/sdd/cache/manager.d.ts +237 -0
- package/dist/sdd/cache/manager.d.ts.map +1 -0
- package/dist/sdd/cache/manager.js +770 -0
- package/dist/sdd/cache/manager.js.map +1 -0
- package/dist/sdd/cache/snapshot-store.d.ts +39 -0
- package/dist/sdd/cache/snapshot-store.d.ts.map +1 -0
- package/dist/sdd/cache/snapshot-store.js +156 -0
- package/dist/sdd/cache/snapshot-store.js.map +1 -0
- package/dist/sdd/changes/manager.d.ts +58 -0
- package/dist/sdd/changes/manager.d.ts.map +1 -0
- package/dist/sdd/changes/manager.js +235 -0
- package/dist/sdd/changes/manager.js.map +1 -0
- package/dist/sdd/cicd/generators.d.ts +16 -0
- package/dist/sdd/cicd/generators.d.ts.map +1 -0
- package/dist/sdd/cicd/generators.js +1042 -0
- package/dist/sdd/cicd/generators.js.map +1 -0
- package/dist/sdd/code-quality/complexity.d.ts +38 -0
- package/dist/sdd/code-quality/complexity.d.ts.map +1 -0
- package/dist/sdd/code-quality/complexity.js +161 -0
- package/dist/sdd/code-quality/complexity.js.map +1 -0
- package/dist/sdd/code-quality/conventions.d.ts +33 -0
- package/dist/sdd/code-quality/conventions.d.ts.map +1 -0
- package/dist/sdd/code-quality/conventions.js +193 -0
- package/dist/sdd/code-quality/conventions.js.map +1 -0
- package/dist/sdd/code-quality/dependencies.d.ts +27 -0
- package/dist/sdd/code-quality/dependencies.d.ts.map +1 -0
- package/dist/sdd/code-quality/dependencies.js +142 -0
- package/dist/sdd/code-quality/dependencies.js.map +1 -0
- package/dist/sdd/code-quality/import-analyzer.d.ts +49 -0
- package/dist/sdd/code-quality/import-analyzer.d.ts.map +1 -0
- package/dist/sdd/code-quality/import-analyzer.js +213 -0
- package/dist/sdd/code-quality/import-analyzer.js.map +1 -0
- package/dist/sdd/code-quality/metrics.d.ts +35 -0
- package/dist/sdd/code-quality/metrics.d.ts.map +1 -0
- package/dist/sdd/code-quality/metrics.js +172 -0
- package/dist/sdd/code-quality/metrics.js.map +1 -0
- package/dist/sdd/code-quality/smells.d.ts +38 -0
- package/dist/sdd/code-quality/smells.d.ts.map +1 -0
- package/dist/sdd/code-quality/smells.js +319 -0
- package/dist/sdd/code-quality/smells.js.map +1 -0
- package/dist/sdd/code-quality/symbol-parser.d.ts +28 -0
- package/dist/sdd/code-quality/symbol-parser.d.ts.map +1 -0
- package/dist/sdd/code-quality/symbol-parser.js +230 -0
- package/dist/sdd/code-quality/symbol-parser.js.map +1 -0
- package/dist/sdd/code-quality/usage-tracker.d.ts +59 -0
- package/dist/sdd/code-quality/usage-tracker.d.ts.map +1 -0
- package/dist/sdd/code-quality/usage-tracker.js +402 -0
- package/dist/sdd/code-quality/usage-tracker.js.map +1 -0
- package/dist/sdd/code-quality/utils.d.ts +6 -0
- package/dist/sdd/code-quality/utils.d.ts.map +1 -0
- package/dist/sdd/code-quality/utils.js +14 -0
- package/dist/sdd/code-quality/utils.js.map +1 -0
- package/dist/sdd/codegen/generator.d.ts +42 -0
- package/dist/sdd/codegen/generator.d.ts.map +1 -0
- package/dist/sdd/codegen/generator.js +1023 -0
- package/dist/sdd/codegen/generator.js.map +1 -0
- package/dist/sdd/constitution/validator.d.ts +37 -0
- package/dist/sdd/constitution/validator.d.ts.map +1 -0
- package/dist/sdd/constitution/validator.js +192 -0
- package/dist/sdd/constitution/validator.js.map +1 -0
- package/dist/sdd/cost/estimator.d.ts +31 -0
- package/dist/sdd/cost/estimator.d.ts.map +1 -0
- package/dist/sdd/cost/estimator.js +92 -0
- package/dist/sdd/cost/estimator.js.map +1 -0
- package/dist/sdd/coverage/tracker.d.ts +47 -0
- package/dist/sdd/coverage/tracker.d.ts.map +1 -0
- package/dist/sdd/coverage/tracker.js +251 -0
- package/dist/sdd/coverage/tracker.js.map +1 -0
- package/dist/sdd/disaster/recovery.d.ts +11 -0
- package/dist/sdd/disaster/recovery.d.ts.map +1 -0
- package/dist/sdd/disaster/recovery.js +55 -0
- package/dist/sdd/disaster/recovery.js.map +1 -0
- package/dist/sdd/discovery/adaptive.d.ts +14 -0
- package/dist/sdd/discovery/adaptive.d.ts.map +1 -0
- package/dist/sdd/discovery/adaptive.js +145 -0
- package/dist/sdd/discovery/adaptive.js.map +1 -0
- package/dist/sdd/discovery/briefing-analyzer.d.ts +66 -0
- package/dist/sdd/discovery/briefing-analyzer.d.ts.map +1 -0
- package/dist/sdd/discovery/briefing-analyzer.js +672 -0
- package/dist/sdd/discovery/briefing-analyzer.js.map +1 -0
- package/dist/sdd/discovery/briefing.d.ts +109 -0
- package/dist/sdd/discovery/briefing.d.ts.map +1 -0
- package/dist/sdd/discovery/briefing.js +617 -0
- package/dist/sdd/discovery/briefing.js.map +1 -0
- package/dist/sdd/discovery/graph-builder.d.ts +10 -0
- package/dist/sdd/discovery/graph-builder.d.ts.map +1 -0
- package/dist/sdd/discovery/graph-builder.js +510 -0
- package/dist/sdd/discovery/graph-builder.js.map +1 -0
- package/dist/sdd/documentation/generator.d.ts +7 -0
- package/dist/sdd/documentation/generator.d.ts.map +1 -0
- package/dist/sdd/documentation/generator.js +119 -0
- package/dist/sdd/documentation/generator.js.map +1 -0
- package/dist/sdd/domain/types.d.ts +460 -0
- package/dist/sdd/domain/types.d.ts.map +1 -0
- package/dist/sdd/domain/types.js +25 -0
- package/dist/sdd/domain/types.js.map +1 -0
- package/dist/sdd/drift/detector.d.ts +28 -0
- package/dist/sdd/drift/detector.d.ts.map +1 -0
- package/dist/sdd/drift/detector.js +379 -0
- package/dist/sdd/drift/detector.js.map +1 -0
- package/dist/sdd/drift/exclusion.d.ts +54 -0
- package/dist/sdd/drift/exclusion.d.ts.map +1 -0
- package/dist/sdd/drift/exclusion.js +179 -0
- package/dist/sdd/drift/exclusion.js.map +1 -0
- package/dist/sdd/drift/signals.d.ts +52 -0
- package/dist/sdd/drift/signals.d.ts.map +1 -0
- package/dist/sdd/drift/signals.js +470 -0
- package/dist/sdd/drift/signals.js.map +1 -0
- package/dist/sdd/enforcement/interceptor.d.ts +47 -0
- package/dist/sdd/enforcement/interceptor.d.ts.map +1 -0
- package/dist/sdd/enforcement/interceptor.js +365 -0
- package/dist/sdd/enforcement/interceptor.js.map +1 -0
- package/dist/sdd/enforcement/workflow-tracker.d.ts +66 -0
- package/dist/sdd/enforcement/workflow-tracker.d.ts.map +1 -0
- package/dist/sdd/enforcement/workflow-tracker.js +229 -0
- package/dist/sdd/enforcement/workflow-tracker.js.map +1 -0
- package/dist/sdd/graph/engine.d.ts +44 -0
- package/dist/sdd/graph/engine.d.ts.map +1 -0
- package/dist/sdd/graph/engine.js +203 -0
- package/dist/sdd/graph/engine.js.map +1 -0
- package/dist/sdd/graph/index.d.ts +160 -0
- package/dist/sdd/graph/index.d.ts.map +1 -0
- package/dist/sdd/graph/index.js +624 -0
- package/dist/sdd/graph/index.js.map +1 -0
- package/dist/sdd/graph/integrity-guard.d.ts +129 -0
- package/dist/sdd/graph/integrity-guard.d.ts.map +1 -0
- package/dist/sdd/graph/integrity-guard.js +263 -0
- package/dist/sdd/graph/integrity-guard.js.map +1 -0
- package/dist/sdd/graph/integrity.d.ts +79 -0
- package/dist/sdd/graph/integrity.d.ts.map +1 -0
- package/dist/sdd/graph/integrity.js +462 -0
- package/dist/sdd/graph/integrity.js.map +1 -0
- package/dist/sdd/graph/pruner.d.ts +27 -0
- package/dist/sdd/graph/pruner.d.ts.map +1 -0
- package/dist/sdd/graph/pruner.js +203 -0
- package/dist/sdd/graph/pruner.js.map +1 -0
- package/dist/sdd/graph/traverse.d.ts +43 -0
- package/dist/sdd/graph/traverse.d.ts.map +1 -0
- package/dist/sdd/graph/traverse.js +265 -0
- package/dist/sdd/graph/traverse.js.map +1 -0
- package/dist/sdd/incidents/manager.d.ts +10 -0
- package/dist/sdd/incidents/manager.d.ts.map +1 -0
- package/dist/sdd/incidents/manager.js +63 -0
- package/dist/sdd/incidents/manager.js.map +1 -0
- package/dist/sdd/knowledge/transfer.d.ts +24 -0
- package/dist/sdd/knowledge/transfer.d.ts.map +1 -0
- package/dist/sdd/knowledge/transfer.js +94 -0
- package/dist/sdd/knowledge/transfer.js.map +1 -0
- package/dist/sdd/migrations/fixes.d.ts +2 -0
- package/dist/sdd/migrations/fixes.d.ts.map +1 -0
- package/dist/sdd/migrations/fixes.js +159 -0
- package/dist/sdd/migrations/fixes.js.map +1 -0
- package/dist/sdd/migrations/index.d.ts +2 -0
- package/dist/sdd/migrations/index.d.ts.map +1 -0
- package/dist/sdd/migrations/index.js +5 -0
- package/dist/sdd/migrations/index.js.map +1 -0
- package/dist/sdd/migrations/migration-runner.d.ts +41 -0
- package/dist/sdd/migrations/migration-runner.d.ts.map +1 -0
- package/dist/sdd/migrations/migration-runner.js +91 -0
- package/dist/sdd/migrations/migration-runner.js.map +1 -0
- package/dist/sdd/monitoring/setup.d.ts +40 -0
- package/dist/sdd/monitoring/setup.d.ts.map +1 -0
- package/dist/sdd/monitoring/setup.js +177 -0
- package/dist/sdd/monitoring/setup.js.map +1 -0
- package/dist/sdd/monitoring/telemetry.d.ts +18 -0
- package/dist/sdd/monitoring/telemetry.d.ts.map +1 -0
- package/dist/sdd/monitoring/telemetry.js +37 -0
- package/dist/sdd/monitoring/telemetry.js.map +1 -0
- package/dist/sdd/patterns/anti-patterns.d.ts +21 -0
- package/dist/sdd/patterns/anti-patterns.d.ts.map +1 -0
- package/dist/sdd/patterns/anti-patterns.js +286 -0
- package/dist/sdd/patterns/anti-patterns.js.map +1 -0
- package/dist/sdd/patterns/ast-clones.d.ts +23 -0
- package/dist/sdd/patterns/ast-clones.d.ts.map +1 -0
- package/dist/sdd/patterns/ast-clones.js +171 -0
- package/dist/sdd/patterns/ast-clones.js.map +1 -0
- package/dist/sdd/patterns/config-drift.d.ts +16 -0
- package/dist/sdd/patterns/config-drift.d.ts.map +1 -0
- package/dist/sdd/patterns/config-drift.js +322 -0
- package/dist/sdd/patterns/config-drift.js.map +1 -0
- package/dist/sdd/patterns/contradictions.d.ts +38 -0
- package/dist/sdd/patterns/contradictions.d.ts.map +1 -0
- package/dist/sdd/patterns/contradictions.js +237 -0
- package/dist/sdd/patterns/contradictions.js.map +1 -0
- package/dist/sdd/patterns/learner.d.ts +49 -0
- package/dist/sdd/patterns/learner.d.ts.map +1 -0
- package/dist/sdd/patterns/learner.js +226 -0
- package/dist/sdd/patterns/learner.js.map +1 -0
- package/dist/sdd/permissions/access.d.ts +69 -0
- package/dist/sdd/permissions/access.d.ts.map +1 -0
- package/dist/sdd/permissions/access.js +333 -0
- package/dist/sdd/permissions/access.js.map +1 -0
- package/dist/sdd/persistence/repository.d.ts +60 -0
- package/dist/sdd/persistence/repository.d.ts.map +1 -0
- package/dist/sdd/persistence/repository.js +96 -0
- package/dist/sdd/persistence/repository.js.map +1 -0
- package/dist/sdd/persistence/sqlite.d.ts +122 -0
- package/dist/sdd/persistence/sqlite.d.ts.map +1 -0
- package/dist/sdd/persistence/sqlite.js +602 -0
- package/dist/sdd/persistence/sqlite.js.map +1 -0
- package/dist/sdd/persistence/yaml.d.ts +41 -0
- package/dist/sdd/persistence/yaml.d.ts.map +1 -0
- package/dist/sdd/persistence/yaml.js +382 -0
- package/dist/sdd/persistence/yaml.js.map +1 -0
- package/dist/sdd/promises/classifier.d.ts +48 -0
- package/dist/sdd/promises/classifier.d.ts.map +1 -0
- package/dist/sdd/promises/classifier.js +215 -0
- package/dist/sdd/promises/classifier.js.map +1 -0
- package/dist/sdd/promises/tracker.d.ts +20 -0
- package/dist/sdd/promises/tracker.d.ts.map +1 -0
- package/dist/sdd/promises/tracker.js +204 -0
- package/dist/sdd/promises/tracker.js.map +1 -0
- package/dist/sdd/quality/scorer.d.ts +44 -0
- package/dist/sdd/quality/scorer.d.ts.map +1 -0
- package/dist/sdd/quality/scorer.js +216 -0
- package/dist/sdd/quality/scorer.js.map +1 -0
- package/dist/sdd/rollback/manager.d.ts +45 -0
- package/dist/sdd/rollback/manager.d.ts.map +1 -0
- package/dist/sdd/rollback/manager.js +266 -0
- package/dist/sdd/rollback/manager.js.map +1 -0
- package/dist/sdd/session/handoff.d.ts +52 -0
- package/dist/sdd/session/handoff.d.ts.map +1 -0
- package/dist/sdd/session/handoff.js +264 -0
- package/dist/sdd/session/handoff.js.map +1 -0
- package/dist/sdd/sla/tracker.d.ts +11 -0
- package/dist/sdd/sla/tracker.d.ts.map +1 -0
- package/dist/sdd/sla/tracker.js +52 -0
- package/dist/sdd/sla/tracker.js.map +1 -0
- package/dist/sdd/sync/git-sync.d.ts +61 -0
- package/dist/sdd/sync/git-sync.d.ts.map +1 -0
- package/dist/sdd/sync/git-sync.js +297 -0
- package/dist/sdd/sync/git-sync.js.map +1 -0
- package/dist/sdd/toggle/state.d.ts +8 -0
- package/dist/sdd/toggle/state.d.ts.map +1 -0
- package/dist/sdd/toggle/state.js +32 -0
- package/dist/sdd/toggle/state.js.map +1 -0
- package/dist/sdd/transactions/manager.d.ts +12 -0
- package/dist/sdd/transactions/manager.d.ts.map +1 -0
- package/dist/sdd/transactions/manager.js +80 -0
- package/dist/sdd/transactions/manager.js.map +1 -0
- package/dist/sdd/validation/coverage-index.d.ts +117 -0
- package/dist/sdd/validation/coverage-index.d.ts.map +1 -0
- package/dist/sdd/validation/coverage-index.js +251 -0
- package/dist/sdd/validation/coverage-index.js.map +1 -0
- package/dist/sdd/validation/executable.d.ts +26 -0
- package/dist/sdd/validation/executable.d.ts.map +1 -0
- package/dist/sdd/validation/executable.js +122 -0
- package/dist/sdd/validation/executable.js.map +1 -0
- package/dist/sdd/validation/smart-validator.d.ts +53 -0
- package/dist/sdd/validation/smart-validator.d.ts.map +1 -0
- package/dist/sdd/validation/smart-validator.js +347 -0
- package/dist/sdd/validation/smart-validator.js.map +1 -0
- package/dist/sdd/validation/validator.d.ts +39 -0
- package/dist/sdd/validation/validator.d.ts.map +1 -0
- package/dist/sdd/validation/validator.js +512 -0
- package/dist/sdd/validation/validator.js.map +1 -0
- package/dist/sdd/workflow/exporter.d.ts +36 -0
- package/dist/sdd/workflow/exporter.d.ts.map +1 -0
- package/dist/sdd/workflow/exporter.js +112 -0
- package/dist/sdd/workflow/exporter.js.map +1 -0
- package/dist/sdd/workflows/ab-testing.d.ts +18 -0
- package/dist/sdd/workflows/ab-testing.d.ts.map +1 -0
- package/dist/sdd/workflows/ab-testing.js +67 -0
- package/dist/sdd/workflows/ab-testing.js.map +1 -0
- package/dist/sdd/workflows/bug-fix.d.ts +13 -0
- package/dist/sdd/workflows/bug-fix.d.ts.map +1 -0
- package/dist/sdd/workflows/bug-fix.js +65 -0
- package/dist/sdd/workflows/bug-fix.js.map +1 -0
- package/dist/sdd/workflows/data-migration.d.ts +14 -0
- package/dist/sdd/workflows/data-migration.d.ts.map +1 -0
- package/dist/sdd/workflows/data-migration.js +68 -0
- package/dist/sdd/workflows/data-migration.js.map +1 -0
- package/dist/sdd/workflows/deprecation.d.ts +15 -0
- package/dist/sdd/workflows/deprecation.d.ts.map +1 -0
- package/dist/sdd/workflows/deprecation.js +68 -0
- package/dist/sdd/workflows/deprecation.js.map +1 -0
- package/dist/sdd/workflows/feature-flags.d.ts +14 -0
- package/dist/sdd/workflows/feature-flags.d.ts.map +1 -0
- package/dist/sdd/workflows/feature-flags.js +73 -0
- package/dist/sdd/workflows/feature-flags.js.map +1 -0
- package/dist/sdd/workflows/hotfix.d.ts +13 -0
- package/dist/sdd/workflows/hotfix.d.ts.map +1 -0
- package/dist/sdd/workflows/hotfix.js +67 -0
- package/dist/sdd/workflows/hotfix.js.map +1 -0
- package/dist/sdd/workflows/multi-tenancy.d.ts +13 -0
- package/dist/sdd/workflows/multi-tenancy.d.ts.map +1 -0
- package/dist/sdd/workflows/multi-tenancy.js +68 -0
- package/dist/sdd/workflows/multi-tenancy.js.map +1 -0
- package/dist/sdd/workflows/onboarding.d.ts +7 -0
- package/dist/sdd/workflows/onboarding.d.ts.map +1 -0
- package/dist/sdd/workflows/onboarding.js +43 -0
- package/dist/sdd/workflows/onboarding.js.map +1 -0
- package/dist/sdd/workflows/refactoring.d.ts +14 -0
- package/dist/sdd/workflows/refactoring.d.ts.map +1 -0
- package/dist/sdd/workflows/refactoring.js +73 -0
- package/dist/sdd/workflows/refactoring.js.map +1 -0
- package/dist/server/events.d.ts +64 -0
- package/dist/server/events.d.ts.map +1 -0
- package/dist/server/events.js +149 -0
- package/dist/server/events.js.map +1 -0
- package/dist/server/server.d.ts +33 -0
- package/dist/server/server.d.ts.map +1 -0
- package/dist/server/server.js +1019 -0
- package/dist/server/server.js.map +1 -0
- package/marketplace.json +39 -0
- package/package.json +65 -0
- package/src/code-intelligence/analyzer.ts +350 -0
- package/src/code-intelligence/ast/cache.ts +61 -0
- package/src/code-intelligence/ast/common.ts +62 -0
- package/src/code-intelligence/ast/component.ts +39 -0
- package/src/code-intelligence/ast/fallback.ts +44 -0
- package/src/code-intelligence/ast/index.ts +4 -0
- package/src/code-intelligence/ast/ir.ts +91 -0
- package/src/code-intelligence/ast/metrics.ts +65 -0
- package/src/code-intelligence/ast/registry.ts +28 -0
- package/src/code-intelligence/ast/tree-sitter.ts +226 -0
- package/src/code-intelligence/ast/typescript.ts +140 -0
- package/src/index.ts +22 -0
- package/src/mcp/server.ts +77 -0
- package/src/opencode/hooks.ts +728 -0
- package/src/opencode/router/categories.ts +192 -0
- package/src/opencode/router/embeddings.ts +149 -0
- package/src/opencode/router/graph-state-snapshot.ts +163 -0
- package/src/opencode/router/index.ts +44 -0
- package/src/opencode/router/intent-classifier.ts +140 -0
- package/src/opencode/router/semantic-nudge.ts +89 -0
- package/src/opencode/router/state-gate.ts +192 -0
- package/src/opencode/router/tool-embeddings.ts +162 -0
- package/src/opencode/router/tool-registry.ts +135 -0
- package/src/opencode/router/tool-taxonomy.ts +284 -0
- package/src/opencode/router/tools-composite.ts +685 -0
- package/src/opencode/shell-hooks.ts +115 -0
- package/src/opencode/system-prompt.ts +617 -0
- package/src/opencode/tools.ts +4102 -0
- package/src/opencode/workflows/chains.ts +205 -0
- package/src/opencode/workflows/executor.ts +172 -0
- package/src/opencode/workflows/index.ts +21 -0
- package/src/opencode/workflows/tools-workflow.ts +91 -0
- package/src/opencode/workflows/types.ts +42 -0
- package/src/sdd/analysis/compliance.ts +279 -0
- package/src/sdd/analysis/scalability.ts +97 -0
- package/src/sdd/analysis/security.ts +135 -0
- package/src/sdd/brownfield/scanner.ts +276 -0
- package/src/sdd/cache/manager.ts +899 -0
- package/src/sdd/cache/snapshot-store.ts +185 -0
- package/src/sdd/changes/manager.ts +326 -0
- package/src/sdd/cicd/generators.ts +1095 -0
- package/src/sdd/code-quality/complexity.ts +235 -0
- package/src/sdd/code-quality/conventions.ts +220 -0
- package/src/sdd/code-quality/dependencies.ts +203 -0
- package/src/sdd/code-quality/import-analyzer.ts +294 -0
- package/src/sdd/code-quality/metrics.ts +232 -0
- package/src/sdd/code-quality/smells.ts +415 -0
- package/src/sdd/code-quality/symbol-parser.ts +335 -0
- package/src/sdd/code-quality/usage-tracker.ts +527 -0
- package/src/sdd/code-quality/utils.ts +13 -0
- package/src/sdd/codegen/generator.ts +1181 -0
- package/src/sdd/constitution/validator.ts +253 -0
- package/src/sdd/cost/estimator.ts +147 -0
- package/src/sdd/coverage/tracker.ts +342 -0
- package/src/sdd/disaster/recovery.ts +79 -0
- package/src/sdd/discovery/adaptive.ts +167 -0
- package/src/sdd/discovery/briefing-analyzer.ts +802 -0
- package/src/sdd/discovery/briefing.ts +770 -0
- package/src/sdd/discovery/graph-builder.ts +598 -0
- package/src/sdd/documentation/generator.ts +158 -0
- package/src/sdd/domain/types.ts +658 -0
- package/src/sdd/drift/detector.ts +465 -0
- package/src/sdd/drift/exclusion.ts +223 -0
- package/src/sdd/drift/signals.ts +577 -0
- package/src/sdd/enforcement/interceptor.ts +444 -0
- package/src/sdd/enforcement/workflow-tracker.ts +263 -0
- package/src/sdd/graph/engine.ts +277 -0
- package/src/sdd/graph/index.ts +700 -0
- package/src/sdd/graph/integrity-guard.ts +348 -0
- package/src/sdd/graph/integrity.ts +628 -0
- package/src/sdd/graph/pruner.ts +221 -0
- package/src/sdd/graph/traverse.ts +331 -0
- package/src/sdd/incidents/manager.ts +87 -0
- package/src/sdd/knowledge/transfer.ts +140 -0
- package/src/sdd/migrations/fixes.ts +154 -0
- package/src/sdd/migrations/index.ts +14 -0
- package/src/sdd/migrations/migration-runner.ts +118 -0
- package/src/sdd/monitoring/setup.ts +237 -0
- package/src/sdd/monitoring/telemetry.ts +44 -0
- package/src/sdd/patterns/anti-patterns.ts +333 -0
- package/src/sdd/patterns/ast-clones.ts +214 -0
- package/src/sdd/patterns/config-drift.ts +346 -0
- package/src/sdd/patterns/contradictions.ts +323 -0
- package/src/sdd/patterns/learner.ts +266 -0
- package/src/sdd/permissions/access.ts +478 -0
- package/src/sdd/persistence/repository.ts +166 -0
- package/src/sdd/persistence/sqlite.ts +703 -0
- package/src/sdd/persistence/yaml.ts +409 -0
- package/src/sdd/promises/classifier.ts +253 -0
- package/src/sdd/promises/tracker.ts +258 -0
- package/src/sdd/quality/scorer.ts +263 -0
- package/src/sdd/rollback/manager.ts +361 -0
- package/src/sdd/session/handoff.ts +354 -0
- package/src/sdd/sla/tracker.ts +68 -0
- package/src/sdd/sync/git-sync.ts +401 -0
- package/src/sdd/toggle/state.ts +38 -0
- package/src/sdd/transactions/manager.ts +93 -0
- package/src/sdd/validation/coverage-index.ts +339 -0
- package/src/sdd/validation/executable.ts +127 -0
- package/src/sdd/validation/smart-validator.ts +470 -0
- package/src/sdd/validation/validator.ts +641 -0
- package/src/sdd/workflow/exporter.ts +169 -0
- package/src/sdd/workflows/ab-testing.ts +90 -0
- package/src/sdd/workflows/bug-fix.ts +81 -0
- package/src/sdd/workflows/data-migration.ts +86 -0
- package/src/sdd/workflows/deprecation.ts +87 -0
- package/src/sdd/workflows/feature-flags.ts +91 -0
- package/src/sdd/workflows/hotfix.ts +83 -0
- package/src/sdd/workflows/multi-tenancy.ts +84 -0
- package/src/sdd/workflows/onboarding.ts +82 -0
- package/src/sdd/workflows/refactoring.ts +90 -0
- package/src/server/events.ts +184 -0
- package/src/server/server.ts +1088 -0
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import { readFileSync, existsSync } from "fs"
|
|
2
|
+
import { join } from "path"
|
|
3
|
+
|
|
4
|
+
export interface ConfigDriftItem {
|
|
5
|
+
file: string
|
|
6
|
+
type: "version_mismatch" | "deprecated_setting" | "missing_config" | "inconsistency"
|
|
7
|
+
description: string
|
|
8
|
+
expected?: string
|
|
9
|
+
actual?: string
|
|
10
|
+
severity: "error" | "warning" | "info"
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ConfigDriftReport {
|
|
14
|
+
items: ConfigDriftItem[]
|
|
15
|
+
total: number
|
|
16
|
+
by_type: Record<string, number>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function detectConfigDrift(projectDir: string): ConfigDriftReport {
|
|
20
|
+
const items: ConfigDriftItem[] = []
|
|
21
|
+
|
|
22
|
+
checkPackageJson(projectDir, items)
|
|
23
|
+
checkTsConfig(projectDir, items)
|
|
24
|
+
checkEnvFiles(projectDir, items)
|
|
25
|
+
checkLockFiles(projectDir, items)
|
|
26
|
+
|
|
27
|
+
const byType: Record<string, number> = {}
|
|
28
|
+
for (const item of items) {
|
|
29
|
+
byType[item.type] = (byType[item.type] || 0) + 1
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
items,
|
|
34
|
+
total: items.length,
|
|
35
|
+
by_type: byType,
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function checkPackageJson(projectDir: string, items: ConfigDriftItem[]): void {
|
|
40
|
+
const path = join(projectDir, "package.json")
|
|
41
|
+
if (!existsSync(path)) return
|
|
42
|
+
|
|
43
|
+
try {
|
|
44
|
+
const content = JSON.parse(readFileSync(path, "utf-8"))
|
|
45
|
+
|
|
46
|
+
const deps = { ...content.dependencies, ...content.devDependencies }
|
|
47
|
+
for (const [name, version] of Object.entries(deps)) {
|
|
48
|
+
if (typeof version === "string" && version.includes("^")) {
|
|
49
|
+
items.push({
|
|
50
|
+
file: "package.json",
|
|
51
|
+
type: "version_mismatch",
|
|
52
|
+
description: `Dependency "${name}" uses caret range: ${version}`,
|
|
53
|
+
expected: "Pinned version",
|
|
54
|
+
actual: version,
|
|
55
|
+
severity: "info",
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (content.scripts) {
|
|
61
|
+
for (const [name, cmd] of Object.entries(content.scripts)) {
|
|
62
|
+
if (typeof cmd === "string" && cmd.includes("react-scripts")) {
|
|
63
|
+
items.push({
|
|
64
|
+
file: "package.json",
|
|
65
|
+
type: "deprecated_setting",
|
|
66
|
+
description: `Script "${name}" uses deprecated "react-scripts"`,
|
|
67
|
+
severity: "warning",
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
} catch {
|
|
73
|
+
// skip invalid json
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function checkTsConfig(projectDir: string, items: ConfigDriftItem[]): void {
|
|
78
|
+
const path = join(projectDir, "tsconfig.json")
|
|
79
|
+
if (!existsSync(path)) return
|
|
80
|
+
|
|
81
|
+
try {
|
|
82
|
+
const content = JSON.parse(readFileSync(path, "utf-8"))
|
|
83
|
+
const compilerOptions = content.compilerOptions || {}
|
|
84
|
+
|
|
85
|
+
if (compilerOptions.strict === false) {
|
|
86
|
+
items.push({
|
|
87
|
+
file: "tsconfig.json",
|
|
88
|
+
type: "inconsistency",
|
|
89
|
+
description: "TypeScript strict mode is disabled",
|
|
90
|
+
expected: "strict: true",
|
|
91
|
+
actual: "strict: false",
|
|
92
|
+
severity: "warning",
|
|
93
|
+
})
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (!compilerOptions.esModuleInterop) {
|
|
97
|
+
items.push({
|
|
98
|
+
file: "tsconfig.json",
|
|
99
|
+
type: "deprecated_setting",
|
|
100
|
+
description: "esModuleInterop is not enabled",
|
|
101
|
+
severity: "info",
|
|
102
|
+
})
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// ── JSX configuration validation ──────────────────────────────
|
|
106
|
+
// Check if project has .tsx files but jsx is not configured
|
|
107
|
+
const hasTsxFiles = hasFilesWithExtension(projectDir, ".tsx")
|
|
108
|
+
if (hasTsxFiles) {
|
|
109
|
+
const jsx = compilerOptions.jsx
|
|
110
|
+
if (!jsx) {
|
|
111
|
+
items.push({
|
|
112
|
+
file: "tsconfig.json",
|
|
113
|
+
type: "missing_config",
|
|
114
|
+
description: "Project contains .tsx files but 'jsx' is not configured in tsconfig.json",
|
|
115
|
+
expected: "jsx: \"react-jsx\" or jsx: \"react\"",
|
|
116
|
+
actual: "jsx: undefined",
|
|
117
|
+
severity: "error",
|
|
118
|
+
})
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Check for SolidJS-specific config
|
|
123
|
+
const hasSolidFiles = hasFilesWithExtension(projectDir, ".tsx") &&
|
|
124
|
+
(content.compilerOptions?.jsxImportSource?.includes("solid") ||
|
|
125
|
+
hasFilesWithContent(projectDir, /from ["']solid-js["']/))
|
|
126
|
+
if (hasSolidFiles && compilerOptions.jsx !== "preserve" && compilerOptions.jsx !== "react-jsx") {
|
|
127
|
+
items.push({
|
|
128
|
+
file: "tsconfig.json",
|
|
129
|
+
type: "inconsistency",
|
|
130
|
+
description: "SolidJS project detected but jsx config may not be compatible",
|
|
131
|
+
expected: "jsx: \"preserve\" with jsxImportSource for SolidJS",
|
|
132
|
+
actual: `jsx: \"${compilerOptions.jsx || "undefined"}\"`,
|
|
133
|
+
severity: "warning",
|
|
134
|
+
})
|
|
135
|
+
}
|
|
136
|
+
} catch {
|
|
137
|
+
// skip invalid json
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Check if a directory contains files with a specific extension.
|
|
143
|
+
*/
|
|
144
|
+
function hasFilesWithExtension(projectDir: string, ext: string): boolean {
|
|
145
|
+
try {
|
|
146
|
+
const fs = require("fs")
|
|
147
|
+
function walk(dir: string): boolean {
|
|
148
|
+
if (!fs.existsSync(dir)) return false
|
|
149
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true })
|
|
150
|
+
for (const entry of entries) {
|
|
151
|
+
if (entry.name === "node_modules" || entry.name === ".sdd" || entry.name === "dist") continue
|
|
152
|
+
const fullPath = join(dir, entry.name)
|
|
153
|
+
if (entry.isDirectory()) {
|
|
154
|
+
if (walk(fullPath)) return true
|
|
155
|
+
} else if (entry.name.endsWith(ext)) {
|
|
156
|
+
return true
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return false
|
|
160
|
+
}
|
|
161
|
+
return walk(projectDir)
|
|
162
|
+
} catch {
|
|
163
|
+
return false
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Check if any source file matches a regex pattern.
|
|
169
|
+
*/
|
|
170
|
+
function hasFilesWithContent(projectDir: string, pattern: RegExp): boolean {
|
|
171
|
+
try {
|
|
172
|
+
const fs = require("fs")
|
|
173
|
+
function walk(dir: string): boolean {
|
|
174
|
+
if (!fs.existsSync(dir)) return false
|
|
175
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true })
|
|
176
|
+
for (const entry of entries) {
|
|
177
|
+
if (entry.name === "node_modules" || entry.name === ".sdd" || entry.name === "dist") continue
|
|
178
|
+
const fullPath = join(dir, entry.name)
|
|
179
|
+
if (entry.isDirectory()) {
|
|
180
|
+
if (walk(fullPath)) return true
|
|
181
|
+
} else if (entry.name.endsWith(".ts") || entry.name.endsWith(".tsx")) {
|
|
182
|
+
try {
|
|
183
|
+
const content = fs.readFileSync(fullPath, "utf-8")
|
|
184
|
+
if (pattern.test(content)) return true
|
|
185
|
+
} catch {}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return false
|
|
189
|
+
}
|
|
190
|
+
return walk(projectDir)
|
|
191
|
+
} catch {
|
|
192
|
+
return false
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function checkEnvFiles(projectDir: string, items: ConfigDriftItem[]): void {
|
|
197
|
+
const envExample = join(projectDir, ".env.example")
|
|
198
|
+
const envLocal = join(projectDir, ".env.local")
|
|
199
|
+
|
|
200
|
+
if (existsSync(envExample) && existsSync(envLocal)) {
|
|
201
|
+
const exampleVars = parseEnvFile(envExample)
|
|
202
|
+
const localVars = parseEnvFile(envLocal)
|
|
203
|
+
|
|
204
|
+
for (const key of exampleVars.keys()) {
|
|
205
|
+
if (!localVars.has(key)) {
|
|
206
|
+
items.push({
|
|
207
|
+
file: ".env.local",
|
|
208
|
+
type: "missing_config",
|
|
209
|
+
description: `Missing environment variable: ${key}`,
|
|
210
|
+
expected: key,
|
|
211
|
+
severity: "warning",
|
|
212
|
+
})
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// ── Check if source code uses env vars not in .env.example ──
|
|
218
|
+
if (existsSync(envExample)) {
|
|
219
|
+
const declaredVars = parseEnvFile(envExample)
|
|
220
|
+
const usedVars = findEnvVarsInSource(projectDir)
|
|
221
|
+
|
|
222
|
+
for (const varName of usedVars) {
|
|
223
|
+
if (!declaredVars.has(varName) && !varName.startsWith("NODE_")) {
|
|
224
|
+
items.push({
|
|
225
|
+
file: ".env.example",
|
|
226
|
+
type: "missing_config",
|
|
227
|
+
description: `Environment variable "${varName}" is used in source code but not declared in .env.example`,
|
|
228
|
+
expected: `${varName}=...`,
|
|
229
|
+
severity: "warning",
|
|
230
|
+
})
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// ── Check if lock file exists ──
|
|
236
|
+
const hasPackageJson = existsSync(join(projectDir, "package.json"))
|
|
237
|
+
const hasLockFile = existsSync(join(projectDir, "package-lock.json")) ||
|
|
238
|
+
existsSync(join(projectDir, "yarn.lock")) ||
|
|
239
|
+
existsSync(join(projectDir, "pnpm-lock.yaml"))
|
|
240
|
+
if (hasPackageJson && !hasLockFile) {
|
|
241
|
+
items.push({
|
|
242
|
+
file: "package.json",
|
|
243
|
+
type: "missing_config",
|
|
244
|
+
description: "No lock file found (package-lock.json, yarn.lock, or pnpm-lock.yaml)",
|
|
245
|
+
severity: "warning",
|
|
246
|
+
})
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Scan source files for process.env.XXX usage.
|
|
252
|
+
*/
|
|
253
|
+
function findEnvVarsInSource(projectDir: string): Set<string> {
|
|
254
|
+
const vars = new Set<string>()
|
|
255
|
+
try {
|
|
256
|
+
const fs = require("fs")
|
|
257
|
+
const path = require("path")
|
|
258
|
+
const srcDir = path.join(projectDir, "src")
|
|
259
|
+
if (!fs.existsSync(srcDir)) return vars
|
|
260
|
+
|
|
261
|
+
const EXTENSIONS = [".ts", ".tsx", ".js", ".jsx", ".vue", ".svelte"]
|
|
262
|
+
const EXCLUDE = ["node_modules", ".sdd", "dist", "build", ".git"]
|
|
263
|
+
|
|
264
|
+
function walk(dir: string): void {
|
|
265
|
+
if (!fs.existsSync(dir)) return
|
|
266
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true })
|
|
267
|
+
for (const entry of entries) {
|
|
268
|
+
if (EXCLUDE.includes(entry.name)) continue
|
|
269
|
+
const fullPath = path.join(dir, entry.name)
|
|
270
|
+
if (entry.isDirectory()) {
|
|
271
|
+
walk(fullPath)
|
|
272
|
+
} else if (EXTENSIONS.some(ext => entry.name.endsWith(ext))) {
|
|
273
|
+
try {
|
|
274
|
+
const content = fs.readFileSync(fullPath, "utf-8")
|
|
275
|
+
const matches = content.matchAll(/process\.env\.([A-Z_][A-Z0-9_]*)/g)
|
|
276
|
+
for (const match of matches) {
|
|
277
|
+
vars.add(match[1])
|
|
278
|
+
}
|
|
279
|
+
} catch {}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
walk(srcDir)
|
|
284
|
+
} catch {}
|
|
285
|
+
return vars
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
function checkLockFiles(projectDir: string, items: ConfigDriftItem[]): void {
|
|
289
|
+
const hasPackageLock = existsSync(join(projectDir, "package-lock.json"))
|
|
290
|
+
const hasYarnLock = existsSync(join(projectDir, "yarn.lock"))
|
|
291
|
+
const hasPnpmLock = existsSync(join(projectDir, "pnpm-lock.yaml"))
|
|
292
|
+
|
|
293
|
+
const lockCount = [hasPackageLock, hasYarnLock, hasPnpmLock].filter(Boolean).length
|
|
294
|
+
if (lockCount > 1) {
|
|
295
|
+
items.push({
|
|
296
|
+
file: "root",
|
|
297
|
+
type: "inconsistency",
|
|
298
|
+
description: "Multiple lock files found (package-lock.json, yarn.lock, pnpm-lock.yaml)",
|
|
299
|
+
severity: "warning",
|
|
300
|
+
})
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function parseEnvFile(path: string): Map<string, string> {
|
|
305
|
+
const vars = new Map<string, string>()
|
|
306
|
+
try {
|
|
307
|
+
const content = readFileSync(path, "utf-8")
|
|
308
|
+
for (const line of content.split("\n")) {
|
|
309
|
+
const trimmed = line.trim()
|
|
310
|
+
if (trimmed && !trimmed.startsWith("#")) {
|
|
311
|
+
const eqIndex = trimmed.indexOf("=")
|
|
312
|
+
if (eqIndex > 0) {
|
|
313
|
+
const key = trimmed.slice(0, eqIndex).trim()
|
|
314
|
+
vars.set(key, trimmed.slice(eqIndex + 1).trim())
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
} catch {
|
|
319
|
+
// skip
|
|
320
|
+
}
|
|
321
|
+
return vars
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export function formatConfigDriftReport(report: ConfigDriftReport): string {
|
|
325
|
+
const lines = [
|
|
326
|
+
`## Config Drift (${report.total} items)`,
|
|
327
|
+
"",
|
|
328
|
+
]
|
|
329
|
+
|
|
330
|
+
if (report.total === 0) {
|
|
331
|
+
lines.push("✅ No config drift detected.")
|
|
332
|
+
return lines.join("\n")
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
for (const [type, count] of Object.entries(report.by_type)) {
|
|
336
|
+
lines.push(`- **${type}**: ${count}`)
|
|
337
|
+
}
|
|
338
|
+
lines.push("")
|
|
339
|
+
|
|
340
|
+
for (const item of report.items) {
|
|
341
|
+
const severity = item.severity === "error" ? "🔴" : item.severity === "warning" ? "🟡" : "🔵"
|
|
342
|
+
lines.push(`${severity} **${item.file}**: ${item.description}`)
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
return lines.join("\n")
|
|
346
|
+
}
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import type { KnowledgeGraph, RequirementNode, BusinessRuleNode } from "../domain/types.js"
|
|
2
|
+
import { getNodesByType } from "../graph/engine.js"
|
|
3
|
+
import { getExclusionSets, isNodeExcludedOrDeprecated } from "../drift/exclusion.js"
|
|
4
|
+
import { GraphIndices } from "../graph/index.js"
|
|
5
|
+
|
|
6
|
+
export interface Contradiction {
|
|
7
|
+
node_a: string
|
|
8
|
+
node_b: string
|
|
9
|
+
type: "requirement_conflict" | "rule_conflict" | "cross_type_conflict"
|
|
10
|
+
description: string
|
|
11
|
+
severity: "error" | "warning"
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ContradictionReport {
|
|
15
|
+
contradictions: Contradiction[]
|
|
16
|
+
total: number
|
|
17
|
+
by_type: Record<string, number>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Options for controlling contradiction detection scope.
|
|
22
|
+
*/
|
|
23
|
+
export interface ContradictionDetectionOptions {
|
|
24
|
+
/** Only check these node types (e.g., ["requirement", "business_rule"]). */
|
|
25
|
+
focusNodeTypes?: string[]
|
|
26
|
+
/** Only check nodes whose name/description contains these keywords. */
|
|
27
|
+
focusKeywords?: string[]
|
|
28
|
+
/** Only check nodes in these domains (matched against node name/description). */
|
|
29
|
+
focusDomains?: string[]
|
|
30
|
+
/** Skip these specific node IDs. */
|
|
31
|
+
excludeNodeIds?: string[]
|
|
32
|
+
/** Skip these contradiction types. */
|
|
33
|
+
excludeTypes?: Array<"requirement_conflict" | "rule_conflict" | "cross_type_conflict">
|
|
34
|
+
/** Already verified node pairs — skip these. */
|
|
35
|
+
alreadyVerified?: Array<{ node_a: string; node_b: string }>
|
|
36
|
+
/** Maximum number of contradictions to report. */
|
|
37
|
+
maxResults?: number
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function detectContradictions(
|
|
41
|
+
graph: KnowledgeGraph,
|
|
42
|
+
options?: ContradictionDetectionOptions,
|
|
43
|
+
): ContradictionReport {
|
|
44
|
+
const contradictions: Contradiction[] = []
|
|
45
|
+
|
|
46
|
+
// Build exclusion sets
|
|
47
|
+
const excludeSet = new Set(options?.excludeNodeIds || [])
|
|
48
|
+
const verifiedPairs = new Set<string>()
|
|
49
|
+
if (options?.alreadyVerified) {
|
|
50
|
+
for (const pair of options.alreadyVerified) {
|
|
51
|
+
verifiedPairs.add([pair.node_a, pair.node_b].sort().join("|||"))
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Domain pre-filter: extract shared words for O(1) domain matching
|
|
56
|
+
const domainIndex = buildDomainIndex(graph)
|
|
57
|
+
|
|
58
|
+
const checkReq = !options?.focusNodeTypes || options.focusNodeTypes.includes("requirement")
|
|
59
|
+
const checkRule = !options?.focusNodeTypes || options.focusNodeTypes.includes("business_rule")
|
|
60
|
+
|
|
61
|
+
if (checkReq && !options?.excludeTypes?.includes("requirement_conflict")) {
|
|
62
|
+
detectRequirementContradictions(graph, contradictions, options, excludeSet, verifiedPairs, domainIndex)
|
|
63
|
+
}
|
|
64
|
+
if (checkRule && !options?.excludeTypes?.includes("rule_conflict")) {
|
|
65
|
+
detectRuleContradictions(graph, contradictions, options, excludeSet, verifiedPairs, domainIndex)
|
|
66
|
+
}
|
|
67
|
+
if (checkReq && checkRule && !options?.excludeTypes?.includes("cross_type_conflict")) {
|
|
68
|
+
detectCrossTypeContradictions(graph, contradictions, options, excludeSet, verifiedPairs)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Apply max results limit
|
|
72
|
+
if (options?.maxResults && contradictions.length > options.maxResults) {
|
|
73
|
+
contradictions.splice(options.maxResults)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const byType: Record<string, number> = {}
|
|
77
|
+
for (const c of contradictions) {
|
|
78
|
+
byType[c.type] = (byType[c.type] || 0) + 1
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return {
|
|
82
|
+
contradictions,
|
|
83
|
+
total: contradictions.length,
|
|
84
|
+
by_type: byType,
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function filterByOptions(
|
|
89
|
+
text: string,
|
|
90
|
+
nodeId: string,
|
|
91
|
+
options?: ContradictionDetectionOptions,
|
|
92
|
+
excludeSet?: Set<string>,
|
|
93
|
+
verifiedPairs?: Set<string>,
|
|
94
|
+
otherId?: string,
|
|
95
|
+
): boolean {
|
|
96
|
+
if (excludeSet?.has(nodeId)) return false
|
|
97
|
+
if (otherId && verifiedPairs?.has([nodeId, otherId].sort().join("|||"))) return false
|
|
98
|
+
if (options?.focusKeywords?.length) {
|
|
99
|
+
const textLower = text.toLowerCase()
|
|
100
|
+
if (!options.focusKeywords.some(kw => textLower.includes(kw.toLowerCase()))) return false
|
|
101
|
+
}
|
|
102
|
+
if (options?.focusDomains?.length) {
|
|
103
|
+
const textLower = text.toLowerCase()
|
|
104
|
+
if (!options.focusDomains.some(d => textLower.includes(d.toLowerCase()))) return false
|
|
105
|
+
}
|
|
106
|
+
return true
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function detectRequirementContradictions(
|
|
110
|
+
graph: KnowledgeGraph,
|
|
111
|
+
contradictions: Contradiction[],
|
|
112
|
+
options?: ContradictionDetectionOptions,
|
|
113
|
+
excludeSet?: Set<string>,
|
|
114
|
+
verifiedPairs?: Set<string>,
|
|
115
|
+
domainIndex?: Map<string, Set<string>>,
|
|
116
|
+
): void {
|
|
117
|
+
const { removed, deprecated } = getExclusionSets(graph)
|
|
118
|
+
const requirements = getNodesByType<RequirementNode>(graph, "requirement")
|
|
119
|
+
.filter((r) => !isNodeExcludedOrDeprecated(r.id, r.status, removed, deprecated))
|
|
120
|
+
.filter((r) => filterByOptions(`${r.name} ${r.description || ''}`, r.id, options, excludeSet))
|
|
121
|
+
|
|
122
|
+
// Smart: group by domain for O(n/k) comparisons instead of O(n²)
|
|
123
|
+
if (domainIndex && options?.focusDomains?.length) {
|
|
124
|
+
for (const domain of options.focusDomains) {
|
|
125
|
+
const domainNodes = domainIndex.get(domain.toLowerCase()) || new Set()
|
|
126
|
+
const domainReqs = requirements.filter(r => domainNodes.has(r.id))
|
|
127
|
+
for (let i = 0; i < domainReqs.length; i++) {
|
|
128
|
+
for (let j = i + 1; j < domainReqs.length; j++) {
|
|
129
|
+
if (verifiedPairs?.has([domainReqs[i].id, domainReqs[j].id].sort().join("|||"))) continue
|
|
130
|
+
const conflict = findSemanticConflict(domainReqs[i], domainReqs[j])
|
|
131
|
+
if (conflict) {
|
|
132
|
+
contradictions.push({ node_a: domainReqs[i].id, node_b: domainReqs[j].id, type: "requirement_conflict", description: conflict, severity: "warning" })
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
} else {
|
|
138
|
+
for (let i = 0; i < requirements.length; i++) {
|
|
139
|
+
for (let j = i + 1; j < requirements.length; j++) {
|
|
140
|
+
if (verifiedPairs?.has([requirements[i].id, requirements[j].id].sort().join("|||"))) continue
|
|
141
|
+
const conflict = findSemanticConflict(requirements[i], requirements[j])
|
|
142
|
+
if (conflict) {
|
|
143
|
+
contradictions.push({ node_a: requirements[i].id, node_b: requirements[j].id, type: "requirement_conflict", description: conflict, severity: "warning" })
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function detectRuleContradictions(
|
|
151
|
+
graph: KnowledgeGraph,
|
|
152
|
+
contradictions: Contradiction[],
|
|
153
|
+
options?: ContradictionDetectionOptions,
|
|
154
|
+
excludeSet?: Set<string>,
|
|
155
|
+
verifiedPairs?: Set<string>,
|
|
156
|
+
domainIndex?: Map<string, Set<string>>,
|
|
157
|
+
): void {
|
|
158
|
+
const { removed, deprecated } = getExclusionSets(graph)
|
|
159
|
+
const rules = getNodesByType<BusinessRuleNode>(graph, "business_rule")
|
|
160
|
+
.filter((r) => !isNodeExcludedOrDeprecated(r.id, r.status, removed, deprecated))
|
|
161
|
+
.filter((r) => filterByOptions(`${r.name} ${r.metadata?.rule_text || ''}`, r.id, options, excludeSet))
|
|
162
|
+
|
|
163
|
+
if (domainIndex && options?.focusDomains?.length) {
|
|
164
|
+
for (const domain of options.focusDomains) {
|
|
165
|
+
const domainNodes = domainIndex.get(domain.toLowerCase()) || new Set()
|
|
166
|
+
const domainRules = rules.filter(r => domainNodes.has(r.id))
|
|
167
|
+
for (let i = 0; i < domainRules.length; i++) {
|
|
168
|
+
for (let j = i + 1; j < domainRules.length; j++) {
|
|
169
|
+
if (verifiedPairs?.has([domainRules[i].id, domainRules[j].id].sort().join("|||"))) continue
|
|
170
|
+
const conflict = findRuleConflict(domainRules[i], domainRules[j])
|
|
171
|
+
if (conflict) {
|
|
172
|
+
contradictions.push({ node_a: domainRules[i].id, node_b: domainRules[j].id, type: "rule_conflict", description: conflict, severity: "error" })
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
} else {
|
|
178
|
+
for (let i = 0; i < rules.length; i++) {
|
|
179
|
+
for (let j = i + 1; j < rules.length; j++) {
|
|
180
|
+
if (verifiedPairs?.has([rules[i].id, rules[j].id].sort().join("|||"))) continue
|
|
181
|
+
const conflict = findRuleConflict(rules[i], rules[j])
|
|
182
|
+
if (conflict) {
|
|
183
|
+
contradictions.push({ node_a: rules[i].id, node_b: rules[j].id, type: "rule_conflict", description: conflict, severity: "error" })
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function detectCrossTypeContradictions(
|
|
191
|
+
graph: KnowledgeGraph,
|
|
192
|
+
contradictions: Contradiction[],
|
|
193
|
+
options?: ContradictionDetectionOptions,
|
|
194
|
+
excludeSet?: Set<string>,
|
|
195
|
+
verifiedPairs?: Set<string>,
|
|
196
|
+
): void {
|
|
197
|
+
const { removed, deprecated } = getExclusionSets(graph)
|
|
198
|
+
const requirements = getNodesByType<RequirementNode>(graph, "requirement")
|
|
199
|
+
.filter((r) => !isNodeExcludedOrDeprecated(r.id, r.status, removed, deprecated))
|
|
200
|
+
.filter((r) => filterByOptions(`${r.name} ${r.description || ''}`, r.id, options, excludeSet))
|
|
201
|
+
const rules = getNodesByType<BusinessRuleNode>(graph, "business_rule")
|
|
202
|
+
.filter((r) => !isNodeExcludedOrDeprecated(r.id, r.status, removed, deprecated))
|
|
203
|
+
.filter((r) => filterByOptions(`${r.name} ${r.metadata?.rule_text || ''}`, r.id, options, excludeSet))
|
|
204
|
+
|
|
205
|
+
for (const req of requirements) {
|
|
206
|
+
for (const rule of rules) {
|
|
207
|
+
if (verifiedPairs?.has([req.id, rule.id].sort().join("|||"))) continue
|
|
208
|
+
const conflict = findCrossTypeConflict(req, rule)
|
|
209
|
+
if (conflict) {
|
|
210
|
+
contradictions.push({ node_a: req.id, node_b: rule.id, type: "cross_type_conflict", description: conflict, severity: "warning" })
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Build a domain index mapping domain keywords to node IDs.
|
|
218
|
+
* Used for O(1) domain-based filtering.
|
|
219
|
+
*/
|
|
220
|
+
function buildDomainIndex(graph: KnowledgeGraph): Map<string, Set<string>> {
|
|
221
|
+
const index = new Map<string, Set<string>>()
|
|
222
|
+
for (const node of graph.nodes) {
|
|
223
|
+
const text = `${node.name} ${node.description || ''}`.toLowerCase()
|
|
224
|
+
const words = text.split(/\s+/)
|
|
225
|
+
for (const word of words) {
|
|
226
|
+
if (word.length < 4) continue // Skip short words
|
|
227
|
+
if (!index.has(word)) index.set(word, new Set())
|
|
228
|
+
index.get(word)!.add(node.id)
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return index
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function findSemanticConflict(a: RequirementNode, b: RequirementNode): string | null {
|
|
235
|
+
const descA = (a.description || a.name).toLowerCase()
|
|
236
|
+
const descB = (b.description || b.name).toLowerCase()
|
|
237
|
+
|
|
238
|
+
const negationPairs = [
|
|
239
|
+
["allow", "forbid"], ["enable", "disable"], ["required", "optional"],
|
|
240
|
+
["include", "exclude"], ["must", "must not"], ["always", "never"],
|
|
241
|
+
]
|
|
242
|
+
|
|
243
|
+
for (const [pos, neg] of negationPairs) {
|
|
244
|
+
if ((descA.includes(pos) && descB.includes(neg)) || (descA.includes(neg) && descB.includes(pos))) {
|
|
245
|
+
return `Potentially contradictory requirements: "${a.name}" vs "${b.name}"`
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
return null
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function findRuleConflict(a: BusinessRuleNode, b: BusinessRuleNode): string | null {
|
|
253
|
+
const ruleTextA = a.metadata?.rule_text?.toLowerCase()
|
|
254
|
+
const ruleTextB = b.metadata?.rule_text?.toLowerCase()
|
|
255
|
+
|
|
256
|
+
if (!ruleTextA || !ruleTextB) return null
|
|
257
|
+
|
|
258
|
+
if (ruleTextA.includes("always") && ruleTextB.includes("never")) {
|
|
259
|
+
if (isSameDomain(ruleTextA, ruleTextB)) {
|
|
260
|
+
return `Conflicting rules: "${a.metadata.rule_text}" vs "${b.metadata.rule_text}"`
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if (ruleTextA.includes("allow") && ruleTextB.includes("deny")) {
|
|
265
|
+
if (isSameDomain(ruleTextA, ruleTextB)) {
|
|
266
|
+
return `Conflicting rules: "${a.metadata.rule_text}" vs "${b.metadata.rule_text}"`
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
return null
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
function findCrossTypeConflict(req: RequirementNode, rule: BusinessRuleNode): string | null {
|
|
274
|
+
const reqText = (req.description || req.name).toLowerCase()
|
|
275
|
+
const ruleText = rule.metadata?.rule_text?.toLowerCase()
|
|
276
|
+
|
|
277
|
+
if (!ruleText) return null
|
|
278
|
+
|
|
279
|
+
if (reqText.includes("allow") && ruleText.includes("deny")) {
|
|
280
|
+
if (isSameDomain(reqText, ruleText)) {
|
|
281
|
+
return `Requirement "${req.name}" allows something that business rule "${rule.name}" denies`
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
if (reqText.includes("require") && ruleText.includes("forbid")) {
|
|
286
|
+
if (isSameDomain(reqText, ruleText)) {
|
|
287
|
+
return `Requirement "${req.name}" requires something that business rule "${rule.name}" forbids`
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
return null
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function isSameDomain(textA: string, textB: string): boolean {
|
|
295
|
+
const wordsA = new Set(textA.split(/\s+/))
|
|
296
|
+
const wordsB = new Set(textB.split(/\s+/))
|
|
297
|
+
const overlap = [...wordsA].filter((w) => wordsB.has(w) && w.length > 3)
|
|
298
|
+
return overlap.length >= 2
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export function formatContradictionReport(report: ContradictionReport): string {
|
|
302
|
+
const lines = [
|
|
303
|
+
`## Contradictions (${report.total} total)`,
|
|
304
|
+
"",
|
|
305
|
+
]
|
|
306
|
+
|
|
307
|
+
if (report.total === 0) {
|
|
308
|
+
lines.push("✅ No contradictions detected.")
|
|
309
|
+
return lines.join("\n")
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
for (const [type, count] of Object.entries(report.by_type)) {
|
|
313
|
+
lines.push(`- **${type}**: ${count}`)
|
|
314
|
+
}
|
|
315
|
+
lines.push("")
|
|
316
|
+
|
|
317
|
+
for (const c of report.contradictions) {
|
|
318
|
+
const severity = c.severity === "error" ? "🔴" : "🟡"
|
|
319
|
+
lines.push(`${severity} **${c.node_a}** ↔ **${c.node_b}**: ${c.description}`)
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
return lines.join("\n")
|
|
323
|
+
}
|