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,342 @@
|
|
|
1
|
+
import type { KnowledgeGraph, RequirementNode } from "../domain/types.js"
|
|
2
|
+
import { getNodesByType } from "../graph/engine.js"
|
|
3
|
+
import { getExclusionSets, isNodeExcludedOrDeprecated } from "../drift/exclusion.js"
|
|
4
|
+
|
|
5
|
+
export interface CoverageItem {
|
|
6
|
+
requirement_id: string
|
|
7
|
+
requirement_name: string
|
|
8
|
+
test_id?: string
|
|
9
|
+
test_name?: string
|
|
10
|
+
coverage_type: "full" | "partial" | "none"
|
|
11
|
+
covered_aspects: string[]
|
|
12
|
+
missing_aspects: string[]
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface OrphanTest {
|
|
16
|
+
test_id: string
|
|
17
|
+
test_name: string
|
|
18
|
+
test_path?: string
|
|
19
|
+
inferred_requirement_id?: string
|
|
20
|
+
inferred_by?: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface CoverageReport {
|
|
24
|
+
items: CoverageItem[]
|
|
25
|
+
orphan_tests: OrphanTest[]
|
|
26
|
+
total_requirements: number
|
|
27
|
+
covered_count: number
|
|
28
|
+
partial_count: number
|
|
29
|
+
uncovered_count: number
|
|
30
|
+
coverage_rate: number
|
|
31
|
+
gaps: string[]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Options for controlling coverage analysis scope.
|
|
36
|
+
*/
|
|
37
|
+
export interface CoverageAnalysisOptions {
|
|
38
|
+
/** Only check these specific requirement IDs. */
|
|
39
|
+
focusRequirements?: string[]
|
|
40
|
+
/** Only check these aspects (e.g., ["security", "performance"]). */
|
|
41
|
+
focusAspects?: string[]
|
|
42
|
+
/** Skip these test IDs. */
|
|
43
|
+
excludeTests?: string[]
|
|
44
|
+
/** Skip these requirement IDs. */
|
|
45
|
+
excludeRequirements?: string[]
|
|
46
|
+
/** Only check requirements whose name/description contains these keywords. */
|
|
47
|
+
focusKeywords?: string[]
|
|
48
|
+
/** Maximum items to report. */
|
|
49
|
+
maxResults?: number
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function calculateCoverage(
|
|
53
|
+
graph: KnowledgeGraph,
|
|
54
|
+
options?: CoverageAnalysisOptions,
|
|
55
|
+
): CoverageReport {
|
|
56
|
+
const { removed, deprecated } = getExclusionSets(graph)
|
|
57
|
+
const excludeReqSet = new Set(options?.excludeRequirements || [])
|
|
58
|
+
const excludeTestSet = new Set(options?.excludeTests || [])
|
|
59
|
+
let requirements = getNodesByType<RequirementNode>(graph, "requirement")
|
|
60
|
+
.filter((r) => !isNodeExcludedOrDeprecated(r.id, r.status, removed, deprecated))
|
|
61
|
+
.filter((r) => !excludeReqSet.has(r.id))
|
|
62
|
+
|
|
63
|
+
// Apply focus filters
|
|
64
|
+
if (options?.focusRequirements?.length) {
|
|
65
|
+
const focusSet = new Set(options.focusRequirements)
|
|
66
|
+
requirements = requirements.filter(r => focusSet.has(r.id))
|
|
67
|
+
}
|
|
68
|
+
if (options?.focusKeywords?.length) {
|
|
69
|
+
requirements = requirements.filter(r => {
|
|
70
|
+
const text = `${r.name} ${r.description || ''}`.toLowerCase()
|
|
71
|
+
return options.focusKeywords!.some(kw => text.includes(kw.toLowerCase()))
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const items: CoverageItem[] = []
|
|
76
|
+
const gaps: string[] = []
|
|
77
|
+
|
|
78
|
+
// Find orphan tests (tests not linked to any requirement)
|
|
79
|
+
const allTests = graph.nodes.filter((n) => n.type === "test" && !excludeTestSet.has(n.id))
|
|
80
|
+
const testedReqIds = new Set(
|
|
81
|
+
graph.relationships
|
|
82
|
+
.filter((r) => r.type === "tested_by")
|
|
83
|
+
.map((r) => r.to)
|
|
84
|
+
)
|
|
85
|
+
const orphanTests: OrphanTest[] = allTests
|
|
86
|
+
.filter((t) => !testedReqIds.has(t.id))
|
|
87
|
+
.map((t) => {
|
|
88
|
+
const inferred = inferRequirementFromTest(t, requirements, graph)
|
|
89
|
+
return {
|
|
90
|
+
test_id: t.id,
|
|
91
|
+
test_name: t.name,
|
|
92
|
+
test_path: (t.metadata as any)?.target,
|
|
93
|
+
inferred_requirement_id: inferred?.requirement_id,
|
|
94
|
+
inferred_by: inferred?.method,
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
for (const req of requirements) {
|
|
99
|
+
const testIds = graph.relationships
|
|
100
|
+
.filter((r) => r.from === req.id && r.type === "tested_by")
|
|
101
|
+
.map((r) => r.to)
|
|
102
|
+
.filter(id => !excludeTestSet.has(id))
|
|
103
|
+
|
|
104
|
+
const tests = testIds
|
|
105
|
+
.map((id) => graph.nodes.find((n) => n.id === id))
|
|
106
|
+
.filter(Boolean)
|
|
107
|
+
|
|
108
|
+
let aspects = extractAspects(req)
|
|
109
|
+
|
|
110
|
+
// Apply focus aspects filter
|
|
111
|
+
if (options?.focusAspects?.length) {
|
|
112
|
+
const focusSet = new Set(options.focusAspects.map(a => a.toLowerCase()))
|
|
113
|
+
aspects = aspects.filter(a => focusSet.has(a.split(':')[0].toLowerCase()))
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const coveredAspects = findCoveredAspects(aspects, tests)
|
|
117
|
+
const missingAspects = aspects.filter((a) => !coveredAspects.includes(a))
|
|
118
|
+
|
|
119
|
+
let coverageType: "full" | "partial" | "none" = "none"
|
|
120
|
+
if (missingAspects.length === 0 && aspects.length > 0) coverageType = "full"
|
|
121
|
+
else if (coveredAspects.length > 0) coverageType = "partial"
|
|
122
|
+
|
|
123
|
+
items.push({
|
|
124
|
+
requirement_id: req.id,
|
|
125
|
+
requirement_name: req.name,
|
|
126
|
+
test_id: tests[0]?.id,
|
|
127
|
+
test_name: tests[0]?.name,
|
|
128
|
+
coverage_type: coverageType,
|
|
129
|
+
covered_aspects: coveredAspects,
|
|
130
|
+
missing_aspects: missingAspects,
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
if (coverageType !== "full") {
|
|
134
|
+
gaps.push(`${req.name}: missing coverage for ${missingAspects.join(", ")}`)
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Apply max results limit
|
|
139
|
+
if (options?.maxResults && items.length > options.maxResults) {
|
|
140
|
+
items.splice(options.maxResults)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const covered = items.filter((i) => i.coverage_type === "full").length
|
|
144
|
+
const partial = items.filter((i) => i.coverage_type === "partial").length
|
|
145
|
+
const uncovered = items.filter((i) => i.coverage_type === "none").length
|
|
146
|
+
|
|
147
|
+
return {
|
|
148
|
+
items,
|
|
149
|
+
orphan_tests: orphanTests,
|
|
150
|
+
total_requirements: requirements.length,
|
|
151
|
+
covered_count: covered,
|
|
152
|
+
partial_count: partial,
|
|
153
|
+
uncovered_count: uncovered,
|
|
154
|
+
coverage_rate: requirements.length === 0 ? 1 : covered / requirements.length,
|
|
155
|
+
gaps,
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Infer which requirement a test covers based on name matching.
|
|
161
|
+
* Uses 3 strategies: filename pattern, imports/dependencies, and describe/it blocks.
|
|
162
|
+
*/
|
|
163
|
+
function inferRequirementFromTest(
|
|
164
|
+
test: any,
|
|
165
|
+
requirements: RequirementNode[],
|
|
166
|
+
graph: KnowledgeGraph,
|
|
167
|
+
): { requirement_id: string; method: string } | null {
|
|
168
|
+
const testId = test.id.toLowerCase()
|
|
169
|
+
const testName = (test.name || "").toLowerCase()
|
|
170
|
+
const testPath = ((test.metadata as any)?.target || "").toLowerCase()
|
|
171
|
+
const testText = `${testId} ${testName} ${testPath}`
|
|
172
|
+
|
|
173
|
+
// Strategy 1: Filename pattern matching
|
|
174
|
+
// e.g., "user-auth.test.ts" might test "USER-AUTH-REQ"
|
|
175
|
+
for (const req of requirements) {
|
|
176
|
+
const reqName = req.name.toLowerCase().replace(/\s+/g, "-")
|
|
177
|
+
const reqId = req.id.toLowerCase()
|
|
178
|
+
|
|
179
|
+
if (
|
|
180
|
+
testText.includes(reqName) ||
|
|
181
|
+
testText.includes(reqId) ||
|
|
182
|
+
testName.includes(reqName) ||
|
|
183
|
+
testName.includes(reqId)
|
|
184
|
+
) {
|
|
185
|
+
return { requirement_id: req.id, method: "filename_pattern" }
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// Strategy 2: Import/dependency analysis
|
|
190
|
+
// Check if the test file imports from files related to a requirement
|
|
191
|
+
const testMeta = test.metadata as Record<string, unknown>
|
|
192
|
+
if (Array.isArray(testMeta.imports)) {
|
|
193
|
+
for (const imp of testMeta.imports) {
|
|
194
|
+
if (typeof imp !== "string") continue
|
|
195
|
+
const impLower = imp.toLowerCase()
|
|
196
|
+
for (const req of requirements) {
|
|
197
|
+
const reqName = req.name.toLowerCase().replace(/\s+/g, "-")
|
|
198
|
+
if (impLower.includes(reqName)) {
|
|
199
|
+
return { requirement_id: req.id, method: "import_analysis" }
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// Strategy 3: Relationship-based inference
|
|
206
|
+
// If test is a child of a file that implements a requirement
|
|
207
|
+
if (testMeta.file_path) {
|
|
208
|
+
const fileNodes = graph.nodes.filter(n => n.type === "file")
|
|
209
|
+
for (const file of fileNodes) {
|
|
210
|
+
const fileMeta = file.metadata as { path?: string }
|
|
211
|
+
if (fileMeta.path === testMeta.file_path) {
|
|
212
|
+
// Find what this file implements
|
|
213
|
+
const implementsRels = graph.relationships.filter(
|
|
214
|
+
r => r.from === file.id && r.type === "implements"
|
|
215
|
+
)
|
|
216
|
+
for (const rel of implementsRels) {
|
|
217
|
+
// Check if the target is a requirement or feature containing requirements
|
|
218
|
+
const target = graph.nodes.find(n => n.id === rel.to)
|
|
219
|
+
if (target?.type === "requirement") {
|
|
220
|
+
return { requirement_id: target.id, method: "file_relationship" }
|
|
221
|
+
}
|
|
222
|
+
if (target?.type === "feature") {
|
|
223
|
+
// Find requirements contained by this feature
|
|
224
|
+
const reqRels = graph.relationships.filter(
|
|
225
|
+
r => r.from === target.id && r.type === "contains"
|
|
226
|
+
)
|
|
227
|
+
for (const reqRel of reqRels) {
|
|
228
|
+
const reqNode = graph.nodes.find(n => n.id === reqRel.to)
|
|
229
|
+
if (reqNode?.type === "requirement") {
|
|
230
|
+
return { requirement_id: reqNode.id, method: "feature_relationship" }
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return null
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function extractAspects(req: RequirementNode): string[] {
|
|
243
|
+
const aspects: string[] = []
|
|
244
|
+
|
|
245
|
+
if (req.metadata.priority) aspects.push(`priority:${req.metadata.priority}`)
|
|
246
|
+
|
|
247
|
+
const desc = (req.description || "").toLowerCase()
|
|
248
|
+
if (desc.includes("validation")) aspects.push("validation")
|
|
249
|
+
if (desc.includes("error")) aspects.push("error_handling")
|
|
250
|
+
if (desc.includes("performance")) aspects.push("performance")
|
|
251
|
+
if (desc.includes("security")) aspects.push("security")
|
|
252
|
+
|
|
253
|
+
if (aspects.length === 0) aspects.push("behavior")
|
|
254
|
+
|
|
255
|
+
return [...new Set(aspects)]
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function findCoveredAspects(aspects: string[], tests: any[]): string[] {
|
|
259
|
+
const covered: string[] = []
|
|
260
|
+
|
|
261
|
+
for (const aspect of aspects) {
|
|
262
|
+
const isCovered = tests.some((test) => {
|
|
263
|
+
const testText = ((test.name || "") + " " + (test.description || "")).toLowerCase()
|
|
264
|
+
const aspectKey = aspect.split(":")[0].toLowerCase()
|
|
265
|
+
|
|
266
|
+
return testText.includes(aspectKey) ||
|
|
267
|
+
testText.includes(aspect.toLowerCase()) ||
|
|
268
|
+
testText.includes("all") ||
|
|
269
|
+
testText.includes("comprehensive")
|
|
270
|
+
})
|
|
271
|
+
|
|
272
|
+
if (isCovered) covered.push(aspect)
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
return covered
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export function formatCoverageReport(report: CoverageReport): string {
|
|
279
|
+
const ratePercent = (report.coverage_rate * 100).toFixed(1)
|
|
280
|
+
const lines = [
|
|
281
|
+
`## Test Coverage: ${ratePercent}%`,
|
|
282
|
+
`Covered: ${report.covered_count} | Partial: ${report.partial_count} | Uncovered: ${report.uncovered_count}`,
|
|
283
|
+
"",
|
|
284
|
+
]
|
|
285
|
+
|
|
286
|
+
const grouped = {
|
|
287
|
+
full: report.items.filter((i) => i.coverage_type === "full"),
|
|
288
|
+
partial: report.items.filter((i) => i.coverage_type === "partial"),
|
|
289
|
+
none: report.items.filter((i) => i.coverage_type === "none"),
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
if (grouped.none.length > 0) {
|
|
293
|
+
lines.push("### ❌ Uncovered Requirements")
|
|
294
|
+
for (const item of grouped.none) {
|
|
295
|
+
lines.push(`- **${item.requirement_name}**: ${item.missing_aspects.join(", ")}`)
|
|
296
|
+
}
|
|
297
|
+
lines.push("")
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
if (grouped.partial.length > 0) {
|
|
301
|
+
lines.push("### ⚠️ Partially Covered")
|
|
302
|
+
for (const item of grouped.partial) {
|
|
303
|
+
lines.push(`- **${item.requirement_name}**: missing ${item.missing_aspects.join(", ")}`)
|
|
304
|
+
}
|
|
305
|
+
lines.push("")
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
if (grouped.full.length > 0) {
|
|
309
|
+
lines.push(`### ✅ Fully Covered (${grouped.full.length})`)
|
|
310
|
+
for (const item of grouped.full) {
|
|
311
|
+
lines.push(`- ${item.requirement_name} → ${item.test_name}`)
|
|
312
|
+
}
|
|
313
|
+
lines.push("")
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
if (report.gaps.length > 0) {
|
|
317
|
+
lines.push("### Coverage Gaps")
|
|
318
|
+
for (const gap of report.gaps) {
|
|
319
|
+
lines.push(`- ${gap}`)
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
if (report.orphan_tests.length > 0) {
|
|
324
|
+
lines.push("")
|
|
325
|
+
lines.push(`### 🧪 Tests Without Requirement Link (${report.orphan_tests.length})`)
|
|
326
|
+
lines.push("These tests exist but are not linked to any requirement in the graph:")
|
|
327
|
+
for (const test of report.orphan_tests.slice(0, 15)) {
|
|
328
|
+
const pathInfo = test.test_path ? ` (${test.test_path})` : ""
|
|
329
|
+
const inferredInfo = test.inferred_requirement_id
|
|
330
|
+
? ` → inferred: ${test.inferred_requirement_id} (${test.inferred_by})`
|
|
331
|
+
: ""
|
|
332
|
+
lines.push(`- **${test.test_name}**${pathInfo}${inferredInfo}`)
|
|
333
|
+
}
|
|
334
|
+
if (report.orphan_tests.length > 15) {
|
|
335
|
+
lines.push(`- ... and ${report.orphan_tests.length - 15} more`)
|
|
336
|
+
}
|
|
337
|
+
lines.push("")
|
|
338
|
+
lines.push("Use `sdd.add_relationship` to link: `from=requirement_id, to=test_id, type=tested_by`")
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
return lines.join("\n")
|
|
342
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { KnowledgeGraph } from '../domain/types.js'
|
|
2
|
+
|
|
3
|
+
export interface DisasterRecoveryPlan {
|
|
4
|
+
rto: string
|
|
5
|
+
rpo: string
|
|
6
|
+
backup_strategy: string
|
|
7
|
+
failover_procedure: string[]
|
|
8
|
+
recovery_steps: string[]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function generateDisasterRecoveryPlan(_graph: KnowledgeGraph): DisasterRecoveryPlan {
|
|
12
|
+
const rto = "4 horas"
|
|
13
|
+
const rpo = "1 hora"
|
|
14
|
+
|
|
15
|
+
const backup_strategy = [
|
|
16
|
+
'Backup diário do banco de dados',
|
|
17
|
+
'Backup incremental a cada hora',
|
|
18
|
+
'Backup do Knowledge Graph antes de cada mudança',
|
|
19
|
+
'Armazenamento em localização geográfica diferente',
|
|
20
|
+
].join('\n')
|
|
21
|
+
|
|
22
|
+
const failover_procedure = [
|
|
23
|
+
'Detectar falha principal',
|
|
24
|
+
'Ativar sistema de backup',
|
|
25
|
+
'Redirecionar tráfego',
|
|
26
|
+
'Verificar integridade dos dados',
|
|
27
|
+
'Notificar stakeholders',
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
const recovery_steps = [
|
|
31
|
+
'Avaliar extensão da falha',
|
|
32
|
+
'Restaurar do backup mais recente',
|
|
33
|
+
'Verificar integridade dos dados',
|
|
34
|
+
'Retomar operações normais',
|
|
35
|
+
'Documentar incidente',
|
|
36
|
+
'Implementar melhorias',
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
rto,
|
|
41
|
+
rpo,
|
|
42
|
+
backup_strategy,
|
|
43
|
+
failover_procedure,
|
|
44
|
+
recovery_steps,
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function formatDisasterRecoveryPlan(plan: DisasterRecoveryPlan): string {
|
|
49
|
+
const lines = [
|
|
50
|
+
'## Plano de Disaster Recovery',
|
|
51
|
+
'',
|
|
52
|
+
`**RTO (Recovery Time Objective):** ${plan.rto}`,
|
|
53
|
+
`**RPO (Recovery Point Objective):** ${plan.rpo}`,
|
|
54
|
+
'',
|
|
55
|
+
'### Estratégia de Backup',
|
|
56
|
+
plan.backup_strategy.split('\n').map(line => `- ${line}`).join('\n'),
|
|
57
|
+
'',
|
|
58
|
+
'### Procedimento de Failover',
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
for (let i = 0; i < plan.failover_procedure.length; i++) {
|
|
62
|
+
lines.push(`${i + 1}. ${plan.failover_procedure[i]}`)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
lines.push('', '### Passos de Recuperação')
|
|
66
|
+
for (let i = 0; i < plan.recovery_steps.length; i++) {
|
|
67
|
+
lines.push(`${i + 1}. ${plan.recovery_steps[i]}`)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
lines.push(
|
|
71
|
+
'',
|
|
72
|
+
'### Contatos de Emergência',
|
|
73
|
+
'- **Equipe Principal:** [Adicionar contatos]',
|
|
74
|
+
'- **Fornecedor:** [Adicionar contato]',
|
|
75
|
+
'- **Suporte:** [Adicionar contato]',
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
return lines.join('\n')
|
|
79
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import type { KnowledgeGraph } from "../domain/types.js"
|
|
2
|
+
import { getNodesByType } from "../graph/engine.js"
|
|
3
|
+
import type { QuestionForUser } from "./briefing.js"
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Given a list of discovery questions and the current graph state,
|
|
7
|
+
* filter out questions that are already answered by existing graph data.
|
|
8
|
+
* This prevents redundant questions in brownfield projects.
|
|
9
|
+
*/
|
|
10
|
+
export function filterAlreadyAnswered(
|
|
11
|
+
questions: QuestionForUser[],
|
|
12
|
+
graph: KnowledgeGraph,
|
|
13
|
+
): QuestionForUser[] {
|
|
14
|
+
const existingFeatures = getNodesByType(graph, "feature")
|
|
15
|
+
const existingEntities = getNodesByType(graph, "entity")
|
|
16
|
+
const existingEndpoints = getNodesByType(graph, "endpoint")
|
|
17
|
+
const existingApis = getNodesByType(graph, "api")
|
|
18
|
+
const existingArch = getNodesByType(graph, "architecture_component")
|
|
19
|
+
const existingDb = getNodesByType(graph, "database")
|
|
20
|
+
const existingRules = getNodesByType(graph, "business_rule")
|
|
21
|
+
|
|
22
|
+
// Build sets of existing info
|
|
23
|
+
const existingTechStack = new Set<string>()
|
|
24
|
+
for (const arch of existingArch) {
|
|
25
|
+
const tech = (arch.metadata as any).technology
|
|
26
|
+
if (tech) existingTechStack.add(tech.toLowerCase())
|
|
27
|
+
}
|
|
28
|
+
for (const db of existingDb) {
|
|
29
|
+
const engine = (db.metadata as any).engine
|
|
30
|
+
if (engine) existingTechStack.add(engine.toLowerCase())
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const existingEntityNames = new Set(existingEntities.map(e => e.name.toLowerCase()))
|
|
34
|
+
const existingFeatureNames = new Set(existingFeatures.map(f => f.name.toLowerCase()))
|
|
35
|
+
|
|
36
|
+
return questions.filter(q => {
|
|
37
|
+
const qLower = q.question.toLowerCase()
|
|
38
|
+
const headerLower = q.header.toLowerCase()
|
|
39
|
+
|
|
40
|
+
// Skip framework questions if we already have architecture components
|
|
41
|
+
if ((headerLower.includes("framework") || headerLower.includes("tech") || headerLower.includes("stack")) &&
|
|
42
|
+
existingTechStack.size > 0) {
|
|
43
|
+
return false
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Skip database questions if we already have database nodes
|
|
47
|
+
if ((headerLower.includes("database") || headerLower.includes("banco")) &&
|
|
48
|
+
existingDb.length > 0) {
|
|
49
|
+
return false
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Skip entity questions if entities already exist
|
|
53
|
+
if ((headerLower.includes("entidade") || headerLower.includes("entity") || headerLower.includes("modelo")) &&
|
|
54
|
+
existingEntities.length > 2) {
|
|
55
|
+
return false
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Skip feature questions if features already exist
|
|
59
|
+
if ((headerLower.includes("feature") || headerLower.includes("funcionalidade")) &&
|
|
60
|
+
existingFeatures.length > 2) {
|
|
61
|
+
return false
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Skip API questions if endpoints already exist
|
|
65
|
+
if ((headerLower.includes("api") || headerLower.includes("endpoint") || headerLower.includes("rota")) &&
|
|
66
|
+
existingEndpoints.length > 2) {
|
|
67
|
+
return false
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Skip business rule questions if rules already exist
|
|
71
|
+
if ((headerLower.includes("regra") || headerLower.includes("rule") || headerLower.includes("negócio")) &&
|
|
72
|
+
existingRules.length > 2) {
|
|
73
|
+
return false
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Check if specific options in the question are already covered
|
|
77
|
+
if (q.options && q.options.length > 0) {
|
|
78
|
+
const coveredOptions = q.options.filter(opt => {
|
|
79
|
+
const optLower = opt.label.toLowerCase()
|
|
80
|
+
return existingTechStack.has(optLower) ||
|
|
81
|
+
existingEntityNames.has(optLower) ||
|
|
82
|
+
existingFeatureNames.has(optLower)
|
|
83
|
+
})
|
|
84
|
+
// If most options are already covered, skip this question
|
|
85
|
+
if (coveredOptions.length >= q.options.length * 0.5) {
|
|
86
|
+
return false
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return true
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Generate context-aware questions based on graph gaps.
|
|
96
|
+
* Instead of generic questions, ask about what's actually missing.
|
|
97
|
+
*/
|
|
98
|
+
export function generateGapQuestions(graph: KnowledgeGraph): QuestionForUser[] {
|
|
99
|
+
const questions: QuestionForUser[] = []
|
|
100
|
+
|
|
101
|
+
// Check for requirements without acceptance criteria
|
|
102
|
+
const reqs = getNodesByType(graph, "requirement")
|
|
103
|
+
const reqsWithoutCriteria = reqs.filter(r => {
|
|
104
|
+
const meta = r.metadata as any
|
|
105
|
+
return !meta.acceptance_criteria || meta.acceptance_criteria.length === 0
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
if (reqsWithoutCriteria.length > 0 && reqsWithoutCriteria.length <= 5) {
|
|
109
|
+
for (const req of reqsWithoutCriteria.slice(0, 3)) {
|
|
110
|
+
questions.push({
|
|
111
|
+
question: `What are the acceptance criteria for requirement "${req.name}"?`,
|
|
112
|
+
header: `Acceptance Criteria: ${req.name}`,
|
|
113
|
+
options: [
|
|
114
|
+
{ label: "Functional test", description: "Verify the feature works as expected" },
|
|
115
|
+
{ label: "Edge cases", description: "Handle error scenarios and boundary conditions" },
|
|
116
|
+
{ label: "Performance", description: "Response time and resource usage targets" },
|
|
117
|
+
{ label: "Security", description: "Authentication, authorization, data validation" },
|
|
118
|
+
],
|
|
119
|
+
multiple: true,
|
|
120
|
+
})
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Check for features without requirements
|
|
125
|
+
const features = getNodesByType(graph, "feature")
|
|
126
|
+
const featuresWithoutReqs = features.filter(f => {
|
|
127
|
+
return !graph.relationships.some(r => r.from === f.id && r.type === "contains" &&
|
|
128
|
+
graph.nodes.some(n => n.id === r.to && n.type === "requirement"))
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
if (featuresWithoutReqs.length > 0 && featuresWithoutReqs.length <= 3) {
|
|
132
|
+
for (const feature of featuresWithoutReqs.slice(0, 2)) {
|
|
133
|
+
questions.push({
|
|
134
|
+
question: `What are the specific requirements for feature "${feature.name}"?`,
|
|
135
|
+
header: `Requirements: ${feature.name}`,
|
|
136
|
+
options: [
|
|
137
|
+
{ label: "CRUD operations", description: "Create, Read, Update, Delete" },
|
|
138
|
+
{ label: "Search & filter", description: "Query with filters and pagination" },
|
|
139
|
+
{ label: "Real-time", description: "WebSocket or SSE updates" },
|
|
140
|
+
{ label: "Export", description: "PDF, CSV, or other export formats" },
|
|
141
|
+
],
|
|
142
|
+
multiple: true,
|
|
143
|
+
})
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Check for entities without persistence
|
|
148
|
+
const entities = getNodesByType(graph, "entity")
|
|
149
|
+
const entitiesWithoutDb = entities.filter(e => {
|
|
150
|
+
return !graph.relationships.some(r => r.from === e.id && r.type === "persists_to")
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
if (entitiesWithoutDb.length > 0) {
|
|
154
|
+
questions.push({
|
|
155
|
+
question: `Which database should the ${entitiesWithoutDb.length} entity(ies) (${entitiesWithoutDb.map(e => e.name).join(", ")}) persist to?`,
|
|
156
|
+
header: "Database for entities",
|
|
157
|
+
options: [
|
|
158
|
+
{ label: "PostgreSQL", description: "Relational, full-featured, JSON support" },
|
|
159
|
+
{ label: "SQLite", description: "Lightweight, file-based, good for development" },
|
|
160
|
+
{ label: "MongoDB", description: "Document-based, flexible schema" },
|
|
161
|
+
{ label: "MySQL", description: "Popular relational database" },
|
|
162
|
+
],
|
|
163
|
+
})
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return questions
|
|
167
|
+
}
|