@documentation-robotics/cli 0.1.0 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +466 -693
- package/dist/analysis/data-model-analyzer.js +189 -0
- package/dist/analysis/data-model-analyzer.js.map +7 -0
- package/dist/analysis/index.js +3 -0
- package/dist/analysis/index.js.map +7 -0
- package/dist/analysis/relationship-classifier.js +181 -0
- package/dist/analysis/relationship-classifier.js.map +7 -0
- package/dist/analyzers/base-analyzer.js +1 -0
- package/dist/analyzers/base-analyzer.js.map +7 -0
- package/dist/analyzers/call-graph-utils.js +39 -0
- package/dist/analyzers/call-graph-utils.js.map +7 -0
- package/dist/analyzers/cbm-analyzer.js +1205 -0
- package/dist/analyzers/cbm-analyzer.js.map +7 -0
- package/dist/analyzers/heuristic-utils.js +55 -0
- package/dist/analyzers/heuristic-utils.js.map +7 -0
- package/dist/analyzers/mapping-loader.js +146 -0
- package/dist/analyzers/mapping-loader.js.map +7 -0
- package/dist/analyzers/registry.js +124 -0
- package/dist/analyzers/registry.js.map +7 -0
- package/dist/analyzers/session-state.js +176 -0
- package/dist/analyzers/session-state.js.map +7 -0
- package/dist/analyzers/stdio-client.js +208 -0
- package/dist/analyzers/stdio-client.js.map +7 -0
- package/dist/analyzers/types.js +15 -0
- package/dist/analyzers/types.js.map +7 -0
- package/dist/analyzers/verify-engine.js +209 -0
- package/dist/analyzers/verify-engine.js.map +7 -0
- package/dist/analyzers/verify-ignore.js +130 -0
- package/dist/analyzers/verify-ignore.js.map +7 -0
- package/dist/analyzers/version.js +8 -0
- package/dist/analyzers/version.js.map +7 -0
- package/dist/audit/ai/runner.js +41 -0
- package/dist/audit/ai/runner.js.map +7 -0
- package/dist/audit/differential-analyzer.js +183 -0
- package/dist/audit/differential-analyzer.js.map +7 -0
- package/dist/audit/index.js +32 -0
- package/dist/audit/index.js.map +7 -0
- package/dist/audit/nodes/ai/evaluator.js +49 -0
- package/dist/audit/nodes/ai/evaluator.js.map +7 -0
- package/dist/audit/nodes/ai/parser.js +55 -0
- package/dist/audit/nodes/ai/parser.js.map +7 -0
- package/dist/audit/nodes/ai/prompts.js +103 -0
- package/dist/audit/nodes/ai/prompts.js.map +7 -0
- package/dist/audit/nodes/analysis/node-completeness-checker.js +32 -0
- package/dist/audit/nodes/analysis/node-completeness-checker.js.map +7 -0
- package/dist/audit/nodes/analysis/node-definition-analyzer.js +47 -0
- package/dist/audit/nodes/analysis/node-definition-analyzer.js.map +7 -0
- package/dist/audit/nodes/analysis/node-overlap-detector.js +79 -0
- package/dist/audit/nodes/analysis/node-overlap-detector.js.map +7 -0
- package/dist/audit/nodes/model/orchestrator.js +82 -0
- package/dist/audit/nodes/model/orchestrator.js.map +7 -0
- package/dist/audit/nodes/spec/loader.js +116 -0
- package/dist/audit/nodes/spec/loader.js.map +7 -0
- package/dist/audit/nodes/spec/orchestrator.js +68 -0
- package/dist/audit/nodes/spec/orchestrator.js.map +7 -0
- package/dist/audit/nodes/types.js +1 -0
- package/dist/audit/nodes/types.js.map +7 -0
- package/dist/audit/pipeline/index.js +5 -0
- package/dist/audit/pipeline/index.js.map +7 -0
- package/dist/audit/pipeline/pipeline-orchestrator.js +218 -0
- package/dist/audit/pipeline/pipeline-orchestrator.js.map +7 -0
- package/dist/audit/relationships/ai/evaluator.js +235 -0
- package/dist/audit/relationships/ai/evaluator.js.map +7 -0
- package/dist/audit/relationships/ai/parser.js +197 -0
- package/dist/audit/relationships/ai/parser.js.map +7 -0
- package/dist/audit/relationships/ai/prompts.js +274 -0
- package/dist/audit/relationships/ai/prompts.js.map +7 -0
- package/dist/audit/relationships/analysis/balance-assessor.js +115 -0
- package/dist/audit/relationships/analysis/balance-assessor.js.map +7 -0
- package/dist/audit/relationships/analysis/coverage-analyzer.js +99 -0
- package/dist/audit/relationships/analysis/coverage-analyzer.js.map +7 -0
- package/dist/audit/relationships/analysis/duplicate-detector.js +95 -0
- package/dist/audit/relationships/analysis/duplicate-detector.js.map +7 -0
- package/dist/audit/relationships/analysis/gap-analyzer.js +99 -0
- package/dist/audit/relationships/analysis/gap-analyzer.js.map +7 -0
- package/dist/audit/relationships/analysis/layer-templates.js +294 -0
- package/dist/audit/relationships/analysis/layer-templates.js.map +7 -0
- package/dist/audit/relationships/graph/connectivity.js +129 -0
- package/dist/audit/relationships/graph/connectivity.js.map +7 -0
- package/dist/audit/relationships/graph/relationship-graph.js +179 -0
- package/dist/audit/relationships/graph/relationship-graph.js.map +7 -0
- package/dist/audit/relationships/model/balance-assessor.js +49 -0
- package/dist/audit/relationships/model/balance-assessor.js.map +7 -0
- package/dist/audit/relationships/model/coverage-analyzer.js +34 -0
- package/dist/audit/relationships/model/coverage-analyzer.js.map +7 -0
- package/dist/audit/relationships/model/duplicate-detector.js +68 -0
- package/dist/audit/relationships/model/duplicate-detector.js.map +7 -0
- package/dist/audit/relationships/model/gap-analyzer.js +41 -0
- package/dist/audit/relationships/model/gap-analyzer.js.map +7 -0
- package/dist/audit/relationships/model/orchestrator.js +126 -0
- package/dist/audit/relationships/model/orchestrator.js.map +7 -0
- package/dist/audit/relationships/spec/orchestrator.js +157 -0
- package/dist/audit/relationships/spec/orchestrator.js.map +7 -0
- package/dist/audit/reports/index.js +5 -0
- package/dist/audit/reports/index.js.map +7 -0
- package/dist/audit/reports/report-generator.js +118 -0
- package/dist/audit/reports/report-generator.js.map +7 -0
- package/dist/audit/snapshot-storage.js +163 -0
- package/dist/audit/snapshot-storage.js.map +7 -0
- package/dist/audit/types.js +21 -0
- package/dist/audit/types.js.map +7 -0
- package/dist/cli.js +223 -92
- package/dist/cli.js.map +3 -3
- package/dist/coding-agents/agents/claude-code.js +147 -0
- package/dist/coding-agents/agents/claude-code.js.map +7 -0
- package/dist/coding-agents/agents/index.js +5 -0
- package/dist/coding-agents/agents/index.js.map +7 -0
- package/dist/coding-agents/agents/types.js +1 -0
- package/dist/coding-agents/agents/types.js.map +7 -0
- package/dist/coding-agents/base-chat-client.js +45 -0
- package/dist/coding-agents/base-chat-client.js.map +7 -0
- package/dist/coding-agents/chat-utils.js +23 -0
- package/dist/coding-agents/chat-utils.js.map +7 -0
- package/dist/coding-agents/claude-code-client.js +246 -0
- package/dist/coding-agents/claude-code-client.js.map +7 -0
- package/dist/coding-agents/copilot-client.js +209 -0
- package/dist/coding-agents/copilot-client.js.map +7 -0
- package/dist/commands/add.js +95 -33
- package/dist/commands/add.js.map +2 -2
- package/dist/commands/analyzer.js +511 -0
- package/dist/commands/analyzer.js.map +7 -0
- package/dist/commands/audit-diff.js +49 -0
- package/dist/commands/audit-diff.js.map +7 -0
- package/dist/commands/audit-snapshots.js +62 -0
- package/dist/commands/audit-snapshots.js.map +7 -0
- package/dist/commands/audit.js +81 -0
- package/dist/commands/audit.js.map +7 -0
- package/dist/commands/catalog.js +248 -0
- package/dist/commands/catalog.js.map +7 -0
- package/dist/commands/changeset.js +577 -66
- package/dist/commands/changeset.js.map +2 -2
- package/dist/commands/chat.js +106 -83
- package/dist/commands/chat.js.map +2 -2
- package/dist/commands/claude.js +74 -0
- package/dist/commands/claude.js.map +7 -0
- package/dist/commands/conformance.js +71 -68
- package/dist/commands/conformance.js.map +2 -2
- package/dist/commands/copilot.js +75 -0
- package/dist/commands/copilot.js.map +7 -0
- package/dist/commands/delete.js +125 -11
- package/dist/commands/delete.js.map +3 -3
- package/dist/commands/discover-logic.js +44 -0
- package/dist/commands/discover-logic.js.map +7 -0
- package/dist/commands/docs.js +87 -0
- package/dist/commands/docs.js.map +7 -0
- package/dist/commands/element.js +14 -20
- package/dist/commands/element.js.map +2 -2
- package/dist/commands/export.js +13 -3
- package/dist/commands/export.js.map +2 -2
- package/dist/commands/import.js +51 -0
- package/dist/commands/import.js.map +7 -0
- package/dist/commands/info.js +30 -24
- package/dist/commands/info.js.map +2 -2
- package/dist/commands/init.js +27 -11
- package/dist/commands/init.js.map +2 -2
- package/dist/commands/list.js +63 -13
- package/dist/commands/list.js.map +3 -3
- package/dist/commands/relationship.js +225 -37
- package/dist/commands/relationship.js.map +2 -2
- package/dist/commands/report.js +54 -0
- package/dist/commands/report.js.map +7 -0
- package/dist/commands/reports.js +45 -0
- package/dist/commands/reports.js.map +7 -0
- package/dist/commands/schema.js +135 -0
- package/dist/commands/schema.js.map +7 -0
- package/dist/commands/search.js +40 -12
- package/dist/commands/search.js.map +2 -2
- package/dist/commands/show.js +58 -27
- package/dist/commands/show.js.map +2 -2
- package/dist/commands/stats.js +35 -0
- package/dist/commands/stats.js.map +7 -0
- package/dist/commands/trace.js +39 -16
- package/dist/commands/trace.js.map +2 -2
- package/dist/commands/update.js +141 -14
- package/dist/commands/update.js.map +2 -2
- package/dist/commands/upgrade.js +210 -46
- package/dist/commands/upgrade.js.map +3 -3
- package/dist/commands/validate.js +142 -23
- package/dist/commands/validate.js.map +3 -3
- package/dist/commands/version.js +8 -12
- package/dist/commands/version.js.map +2 -2
- package/dist/commands/visualize.js +162 -25
- package/dist/commands/visualize.js.map +2 -2
- package/dist/core/base-snapshot-manager.js +84 -0
- package/dist/core/base-snapshot-manager.js.map +7 -0
- package/dist/core/changeset-exporter.js +305 -0
- package/dist/core/changeset-exporter.js.map +7 -0
- package/dist/core/changeset-validator.js +41 -0
- package/dist/core/changeset-validator.js.map +7 -0
- package/dist/core/changeset.js +88 -173
- package/dist/core/changeset.js.map +2 -2
- package/dist/core/dependency-tracker.js +4 -2
- package/dist/core/dependency-tracker.js.map +2 -2
- package/dist/core/element.js +98 -27
- package/dist/core/element.js.map +2 -2
- package/dist/core/golden-copy-cache.js +290 -0
- package/dist/core/golden-copy-cache.js.map +7 -0
- package/dist/core/graph-model.js +266 -0
- package/dist/core/graph-model.js.map +7 -0
- package/dist/core/layer.js +159 -16
- package/dist/core/layer.js.map +2 -2
- package/dist/core/layers.js +32 -0
- package/dist/core/layers.js.map +7 -0
- package/dist/core/manifest.js +32 -11
- package/dist/core/manifest.js.map +2 -2
- package/dist/core/migration-registry.js +56 -1
- package/dist/core/migration-registry.js.map +2 -2
- package/dist/core/model.js +424 -217
- package/dist/core/model.js.map +3 -3
- package/dist/core/mutation-handler.js +179 -0
- package/dist/core/mutation-handler.js.map +7 -0
- package/dist/core/reference-registry.js +29 -21
- package/dist/core/reference-registry.js.map +2 -2
- package/dist/core/relationship-catalog.js +189 -0
- package/dist/core/relationship-catalog.js.map +7 -0
- package/dist/core/relationship-registry.js.map +2 -2
- package/dist/core/relationships.js.map +1 -1
- package/dist/core/report-data-model.js +285 -0
- package/dist/core/report-data-model.js.map +7 -0
- package/dist/core/spec-data-service.js +185 -0
- package/dist/core/spec-data-service.js.map +7 -0
- package/dist/core/spec-loader-types.js +1 -0
- package/dist/core/spec-loader-types.js.map +7 -0
- package/dist/core/spec-loader.js +234 -0
- package/dist/core/spec-loader.js.map +7 -0
- package/dist/core/staged-changeset-storage.js +282 -0
- package/dist/core/staged-changeset-storage.js.map +7 -0
- package/dist/core/staging-area.js +1002 -0
- package/dist/core/staging-area.js.map +7 -0
- package/dist/core/stats-collector.js +169 -0
- package/dist/core/stats-collector.js.map +7 -0
- package/dist/core/virtual-projection.js +443 -0
- package/dist/core/virtual-projection.js.map +7 -0
- package/dist/export/archimate-exporter.js +99 -60
- package/dist/export/archimate-exporter.js.map +2 -2
- package/dist/export/audit-formatters.js +479 -0
- package/dist/export/audit-formatters.js.map +7 -0
- package/dist/export/diff-formatters.js +99 -0
- package/dist/export/diff-formatters.js.map +7 -0
- package/dist/export/export-manager.js.map +2 -2
- package/dist/export/graphml-exporter.js +44 -27
- package/dist/export/graphml-exporter.js.map +2 -2
- package/dist/export/index.js +4 -0
- package/dist/export/index.js.map +2 -2
- package/dist/export/json-schema-exporter.js +55 -42
- package/dist/export/json-schema-exporter.js.map +2 -2
- package/dist/export/markdown-exporter.js +92 -70
- package/dist/export/markdown-exporter.js.map +2 -2
- package/dist/export/markdown-generator.js +248 -0
- package/dist/export/markdown-generator.js.map +7 -0
- package/dist/export/markdown-utils.js +30 -0
- package/dist/export/markdown-utils.js.map +7 -0
- package/dist/export/mermaid-markdown-exporter.js +37 -0
- package/dist/export/mermaid-markdown-exporter.js.map +7 -0
- package/dist/export/openapi-exporter.js +119 -71
- package/dist/export/openapi-exporter.js.map +2 -2
- package/dist/export/plantuml-exporter.js +104 -39
- package/dist/export/plantuml-exporter.js.map +2 -2
- package/dist/export/report-formatters.js +111 -0
- package/dist/export/report-formatters.js.map +7 -0
- package/dist/export/stats-formatters.js +98 -0
- package/dist/export/stats-formatters.js.map +7 -0
- package/dist/export/types.js +2 -14
- package/dist/export/types.js.map +2 -2
- package/dist/export/verify-formatters.js +153 -0
- package/dist/export/verify-formatters.js.map +7 -0
- package/dist/generated/compiled-validators.js +17 -0
- package/dist/generated/compiled-validators.js.map +7 -0
- package/dist/generated/index.js +31 -0
- package/dist/generated/index.js.map +7 -0
- package/dist/generated/layer-registry.js +190 -0
- package/dist/generated/layer-registry.js.map +7 -0
- package/dist/generated/layer-types.js +7 -0
- package/dist/generated/layer-types.js.map +7 -0
- package/dist/generated/node-types.js +1719 -0
- package/dist/generated/node-types.js.map +7 -0
- package/dist/generated/relationship-index.js +14552 -0
- package/dist/generated/relationship-index.js.map +7 -0
- package/dist/import/archimate-importer.js +166 -0
- package/dist/import/archimate-importer.js.map +7 -0
- package/dist/import/index.js +47 -0
- package/dist/import/index.js.map +7 -0
- package/dist/import/openapi-importer.js +143 -0
- package/dist/import/openapi-importer.js.map +7 -0
- package/dist/import/types.js +1 -0
- package/dist/import/types.js.map +7 -0
- package/dist/integrations/base-manager.js +311 -0
- package/dist/integrations/base-manager.js.map +7 -0
- package/dist/integrations/claude-manager.js +360 -0
- package/dist/integrations/claude-manager.js.map +7 -0
- package/dist/integrations/claude_code/agents/dr-advisor.md +253 -0
- package/dist/integrations/claude_code/agents/dr-architect.md +278 -0
- package/dist/integrations/claude_code/agents/dr-extractor.md +286 -0
- package/dist/integrations/claude_code/commands/dr-changeset.md +657 -0
- package/dist/integrations/claude_code/commands/dr-design.md +373 -0
- package/dist/integrations/claude_code/commands/dr-info.md +132 -0
- package/dist/integrations/claude_code/commands/dr-init.md +251 -0
- package/dist/integrations/claude_code/commands/dr-map.md +936 -0
- package/dist/integrations/claude_code/commands/dr-model.md +493 -0
- package/dist/integrations/claude_code/commands/dr-relate.md +814 -0
- package/dist/integrations/claude_code/commands/dr-sync.md +279 -0
- package/dist/integrations/claude_code/commands/dr-validate.md +654 -0
- package/dist/integrations/claude_code/commands/dr-verify.md +559 -0
- package/dist/integrations/claude_code/docs/END_TO_END_WALKTHROUGH.md +903 -0
- package/dist/integrations/claude_code/docs/QUICK_START.md +271 -0
- package/dist/integrations/claude_code/docs/README.md +347 -0
- package/dist/integrations/claude_code/skills/dr_01_motivation_layer/SKILL.md +550 -0
- package/dist/integrations/claude_code/skills/dr_02_business_layer/SKILL.md +620 -0
- package/dist/integrations/claude_code/skills/dr_03_security_layer/SKILL.md +642 -0
- package/dist/integrations/claude_code/skills/dr_04_application_layer/SKILL.md +911 -0
- package/dist/integrations/claude_code/skills/dr_05_technology_layer/SKILL.md +836 -0
- package/dist/integrations/claude_code/skills/dr_06_api_layer/SKILL.md +933 -0
- package/dist/integrations/claude_code/skills/dr_07_data_model_layer/SKILL.md +210 -0
- package/dist/integrations/claude_code/skills/dr_08_dataset_layer/SKILL.md +319 -0
- package/dist/integrations/claude_code/skills/dr_09_ux_layer/SKILL.md +319 -0
- package/dist/integrations/claude_code/skills/dr_10_navigation_layer/SKILL.md +318 -0
- package/dist/integrations/claude_code/skills/dr_11_apm_layer/SKILL.md +273 -0
- package/dist/integrations/claude_code/skills/dr_12_testing_layer/SKILL.md +273 -0
- package/dist/integrations/claude_code/skills/dr_changeset_reviewer/SKILL.md +187 -0
- package/dist/integrations/claude_code/skills/dr_codebase_memory/SKILL.md +590 -0
- package/dist/integrations/claude_code/skills/dr_engineering_guide/SKILL.md +295 -0
- package/dist/integrations/copilot-manager.js +328 -0
- package/dist/integrations/copilot-manager.js.map +7 -0
- package/dist/integrations/github_copilot/agents/dr-advisor.md +243 -0
- package/dist/integrations/github_copilot/agents/dr-architect.md +1567 -0
- package/dist/integrations/github_copilot/skills/dr_01_motivation_layer/SKILL.md +491 -0
- package/dist/integrations/github_copilot/skills/dr_02_business_layer/SKILL.md +539 -0
- package/dist/integrations/github_copilot/skills/dr_03_security_layer/SKILL.md +667 -0
- package/dist/integrations/github_copilot/skills/dr_04_application_layer/SKILL.md +670 -0
- package/dist/integrations/github_copilot/skills/dr_05_technology_layer/SKILL.md +660 -0
- package/dist/integrations/github_copilot/skills/dr_06_api_layer/SKILL.md +855 -0
- package/dist/integrations/github_copilot/skills/dr_07_data_model_layer/SKILL.md +171 -0
- package/dist/integrations/github_copilot/skills/dr_08_dataset_layer/SKILL.md +216 -0
- package/dist/integrations/github_copilot/skills/dr_09_ux_layer/SKILL.md +230 -0
- package/dist/integrations/github_copilot/skills/dr_10_navigation_layer/SKILL.md +228 -0
- package/dist/integrations/github_copilot/skills/dr_11_apm_layer/SKILL.md +234 -0
- package/dist/integrations/github_copilot/skills/dr_12_testing_layer/SKILL.md +230 -0
- package/dist/integrations/github_copilot/skills/dr_changeset_reviewer/SKILL.md +187 -0
- package/dist/integrations/hash-utils.js +51 -0
- package/dist/integrations/hash-utils.js.map +7 -0
- package/dist/integrations/types.js +16 -0
- package/dist/integrations/types.js.map +7 -0
- package/dist/reports/model-layer-report-generator.js +278 -0
- package/dist/reports/model-layer-report-generator.js.map +7 -0
- package/dist/reports/model-report-data.js +57 -0
- package/dist/reports/model-report-data.js.map +7 -0
- package/dist/reports/model-report-orchestrator.js +103 -0
- package/dist/reports/model-report-orchestrator.js.map +7 -0
- package/dist/schemas/bundled/analyzers/cbm.json +595 -0
- package/dist/schemas/bundled/analyzers/manifest.json +9 -0
- package/dist/schemas/bundled/api.json +3411 -0
- package/dist/schemas/bundled/apm.json +2371 -0
- package/dist/schemas/bundled/application.json +1253 -0
- package/dist/schemas/bundled/base.json +1622 -0
- package/dist/schemas/bundled/business.json +1279 -0
- package/dist/schemas/bundled/data-model.json +1298 -0
- package/dist/schemas/bundled/data-store.json +2025 -0
- package/dist/schemas/bundled/manifest.json +93 -0
- package/dist/schemas/bundled/motivation.json +1360 -0
- package/dist/schemas/bundled/navigation.json +1874 -0
- package/dist/schemas/bundled/security.json +3488 -0
- package/dist/schemas/bundled/technology.json +2067 -0
- package/dist/schemas/bundled/testing.json +3120 -0
- package/dist/schemas/bundled/ux.json +3592 -0
- package/dist/server/schemas.js +202 -0
- package/dist/server/schemas.js.map +7 -0
- package/dist/server/server.js +1336 -252
- package/dist/server/server.js.map +3 -3
- package/dist/server/telemetry-middleware.js +22 -15
- package/dist/server/telemetry-middleware.js.map +2 -2
- package/dist/server-entry.js +65 -0
- package/dist/server-entry.js.map +7 -0
- package/dist/telemetry/config.js +89 -0
- package/dist/telemetry/config.js.map +7 -0
- package/dist/telemetry/console-interceptor.js.map +1 -1
- package/dist/telemetry/detect.js +24 -0
- package/dist/telemetry/detect.js.map +7 -0
- package/dist/telemetry/fetch-otlp-exporter.js +112 -0
- package/dist/telemetry/fetch-otlp-exporter.js.map +7 -0
- package/dist/telemetry/index.js +153 -3
- package/dist/telemetry/index.js.map +2 -2
- package/dist/telemetry/resilient-exporter.js +22 -8
- package/dist/telemetry/resilient-exporter.js.map +2 -2
- package/dist/telemetry/resilient-log-exporter.js +17 -8
- package/dist/telemetry/resilient-log-exporter.js.map +2 -2
- package/dist/telemetry/test-instrumentation.js.map +2 -2
- package/dist/types/index.js +84 -0
- package/dist/types/index.js.map +3 -3
- package/dist/types/source-reference.js +1 -0
- package/dist/types/source-reference.js.map +7 -0
- package/dist/utils/chat-logger.js +292 -0
- package/dist/utils/chat-logger.js.map +7 -0
- package/dist/utils/claude-stream.js +8 -0
- package/dist/utils/claude-stream.js.map +7 -0
- package/dist/utils/date-utils.js +7 -0
- package/dist/utils/date-utils.js.map +7 -0
- package/dist/utils/element-utils.js.map +1 -1
- package/dist/utils/errors.js +88 -15
- package/dist/utils/errors.js.map +3 -3
- package/dist/utils/export-python-annotations.js +82 -0
- package/dist/utils/export-python-annotations.js.map +7 -0
- package/dist/utils/file-io.js +7 -2
- package/dist/utils/file-io.js.map +2 -2
- package/dist/utils/file-lock.js +156 -0
- package/dist/utils/file-lock.js.map +7 -0
- package/dist/utils/id-generator.js +18 -0
- package/dist/utils/id-generator.js.map +7 -0
- package/dist/utils/layer-name-formatter.js +16 -0
- package/dist/utils/layer-name-formatter.js.map +7 -0
- package/dist/utils/markdown-anchor.js +7 -0
- package/dist/utils/markdown-anchor.js.map +7 -0
- package/dist/utils/markdown-link.js +12 -0
- package/dist/utils/markdown-link.js.map +7 -0
- package/dist/utils/markdown-table.js +17 -0
- package/dist/utils/markdown-table.js.map +7 -0
- package/dist/utils/mermaid-utils.js +11 -0
- package/dist/utils/mermaid-utils.js.map +7 -0
- package/dist/utils/project-paths.js.map +2 -2
- package/dist/utils/source-reference.js +52 -0
- package/dist/utils/source-reference.js.map +7 -0
- package/dist/utils/spec-installer.js +40 -53
- package/dist/utils/spec-installer.js.map +2 -2
- package/dist/utils/spec-version.js +5 -1
- package/dist/utils/spec-version.js.map +2 -2
- package/dist/utils/string-utils.js +12 -0
- package/dist/utils/string-utils.js.map +7 -0
- package/dist/utils/table-formatting.js +19 -0
- package/dist/utils/table-formatting.js.map +7 -0
- package/dist/validators/index.js +4 -0
- package/dist/validators/index.js.map +2 -2
- package/dist/validators/naming-validator.js +20 -23
- package/dist/validators/naming-validator.js.map +2 -2
- package/dist/validators/reference-validator.js +23 -38
- package/dist/validators/reference-validator.js.map +2 -2
- package/dist/validators/relationship-schema-validator.js +243 -0
- package/dist/validators/relationship-schema-validator.js.map +7 -0
- package/dist/validators/schema-validator.js +168 -68
- package/dist/validators/schema-validator.js.map +2 -2
- package/dist/validators/semantic-validator.js +36 -60
- package/dist/validators/semantic-validator.js.map +2 -2
- package/dist/validators/types.js.map +2 -2
- package/dist/validators/validation-formatter.js +159 -0
- package/dist/validators/validation-formatter.js.map +7 -0
- package/dist/validators/validator.js +24 -38
- package/dist/validators/validator.js.map +2 -2
- package/dist/viewer/README.md +139 -0
- package/dist/viewer/assets/main-CY0Xufuj.css +1 -0
- package/dist/viewer/assets/main-DtgErnwF.js +81 -0
- package/dist/viewer/assets/vendor-CxKvDp2x.js +17 -0
- package/dist/viewer/favicon.svg +11 -0
- package/dist/viewer/fonts/inter/Inter-Black.woff2 +0 -0
- package/dist/viewer/fonts/inter/Inter-Bold.woff2 +0 -0
- package/dist/viewer/fonts/inter/Inter-ExtraBold.woff2 +0 -0
- package/dist/viewer/fonts/inter/Inter-Light.woff2 +0 -0
- package/dist/viewer/fonts/inter/Inter-Medium.woff2 +0 -0
- package/dist/viewer/fonts/inter/Inter-Regular.woff2 +0 -0
- package/dist/viewer/fonts/inter/Inter-SemiBold.woff2 +0 -0
- package/dist/viewer/fonts/jetbrains-mono/JetBrainsMono-Medium.woff2 +0 -0
- package/dist/viewer/fonts/jetbrains-mono/JetBrainsMono-Regular.woff2 +0 -0
- package/dist/viewer/fonts/jetbrains-mono/JetBrainsMono-SemiBold.woff2 +0 -0
- package/dist/viewer/index.html +15 -0
- package/dist/viewer/manifest.json +99 -0
- package/dist/viewer/version.json +1 -0
- package/package.json +42 -16
- package/PYTHON_CLI_PARITY.md +0 -265
- package/PYTHON_CLI_STRUCTURE_UPDATE.md +0 -246
- package/biome.json +0 -42
- package/bunfig.toml +0 -3
- package/dist/ai/claude-client.js +0 -71
- package/dist/ai/claude-client.js.map +0 -7
- package/dist/ai/context-provider.js +0 -129
- package/dist/ai/context-provider.js.map +0 -7
- package/dist/ai/tools.js +0 -231
- package/dist/ai/tools.js.map +0 -7
- package/dist/commands/migrate.js +0 -36
- package/dist/commands/migrate.js.map +0 -7
- package/dist/commands/project.js +0 -74
- package/dist/commands/project.js.map +0 -7
- package/dist/core/active-changeset.js +0 -52
- package/dist/core/active-changeset.js.map +0 -7
- package/dist/core/projection-engine.js +0 -288
- package/dist/core/projection-engine.js.map +0 -7
- package/dist/schemas/bundled/01-motivation-layer.schema.json +0 -942
- package/dist/schemas/bundled/02-business-layer.schema.json +0 -1293
- package/dist/schemas/bundled/03-security-layer.schema.json +0 -2177
- package/dist/schemas/bundled/04-application-layer.schema.json +0 -1328
- package/dist/schemas/bundled/05-technology-layer.schema.json +0 -1465
- package/dist/schemas/bundled/06-api-layer.schema.json +0 -1743
- package/dist/schemas/bundled/07-data-model-layer.schema.json +0 -1253
- package/dist/schemas/bundled/08-datastore-layer.schema.json +0 -892
- package/dist/schemas/bundled/09-ux-layer.schema.json +0 -1506
- package/dist/schemas/bundled/10-navigation-layer.schema.json +0 -843
- package/dist/schemas/bundled/11-apm-observability-layer.schema.json +0 -1430
- package/dist/schemas/bundled/12-testing-layer.schema.json +0 -1091
- package/dist/schemas/bundled/common/layer-extensions.schema.json +0 -266
- package/dist/schemas/bundled/common/predicates.schema.json +0 -493
- package/dist/schemas/bundled/common/relationships.schema.json +0 -791
- package/dist/schemas/bundled/common/source-references.schema.json +0 -71
- package/dist/schemas/bundled/link-registry.json +0 -1839
- package/dist/schemas/bundled/link-registry.schema.json +0 -339
- package/dist/schemas/bundled/relationship-catalog.json +0 -1302
- package/dist/schemas/bundled/relationship-type.schema.json +0 -221
- package/dist/utils/model-path.js +0 -22
- package/dist/utils/model-path.js.map +0 -7
- package/docs/TEST-INSTRUMENTATION.md +0 -405
- package/docs/telemetry.md +0 -427
- package/test-debug.js +0 -33
- package/test-special.mjs +0 -46
- package/test_runner.ts +0 -7
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$id": "https://documentation-robotics.org/schemas/relationship-type.schema.json",
|
|
4
|
-
"title": "Relationship Type Schema",
|
|
5
|
-
"description": "JSON Schema for validating relationship type metadata in the relationship catalog",
|
|
6
|
-
"version": "2.0.0",
|
|
7
|
-
|
|
8
|
-
"definitions": {
|
|
9
|
-
"semantics": {
|
|
10
|
-
"type": "object",
|
|
11
|
-
"description": "Semantic properties of the relationship",
|
|
12
|
-
"properties": {
|
|
13
|
-
"directionality": {
|
|
14
|
-
"type": "string",
|
|
15
|
-
"enum": ["unidirectional", "bidirectional"],
|
|
16
|
-
"description": "Whether the relationship supports navigation in both directions"
|
|
17
|
-
},
|
|
18
|
-
"transitivity": {
|
|
19
|
-
"type": "boolean",
|
|
20
|
-
"description": "Whether the relationship is transitive (if A→B and B→C, then A→C)"
|
|
21
|
-
},
|
|
22
|
-
"symmetry": {
|
|
23
|
-
"type": "boolean",
|
|
24
|
-
"description": "Whether the relationship is symmetric (if A→B then B→A)"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
"required": ["directionality", "transitivity", "symmetry"],
|
|
28
|
-
"additionalProperties": false
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
"example": {
|
|
32
|
-
"type": "object",
|
|
33
|
-
"description": "Example usage of the relationship",
|
|
34
|
-
"properties": {
|
|
35
|
-
"source": {
|
|
36
|
-
"type": "string",
|
|
37
|
-
"description": "Source element type"
|
|
38
|
-
},
|
|
39
|
-
"sourceLayer": {
|
|
40
|
-
"type": "string",
|
|
41
|
-
"pattern": "^\\d{2}-.+$",
|
|
42
|
-
"description": "Source layer (e.g., '02-business')"
|
|
43
|
-
},
|
|
44
|
-
"target": {
|
|
45
|
-
"type": "string",
|
|
46
|
-
"description": "Target element type"
|
|
47
|
-
},
|
|
48
|
-
"targetLayer": {
|
|
49
|
-
"type": "string",
|
|
50
|
-
"pattern": "^\\d{2}-.+$",
|
|
51
|
-
"description": "Target layer (e.g., '01-motivation')"
|
|
52
|
-
},
|
|
53
|
-
"value": {
|
|
54
|
-
"type": "string",
|
|
55
|
-
"description": "Example value (ID, reference, etc.)"
|
|
56
|
-
},
|
|
57
|
-
"description": {
|
|
58
|
-
"type": "string",
|
|
59
|
-
"description": "Human-readable description of the example"
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
"required": ["source", "target", "description"],
|
|
63
|
-
"additionalProperties": false
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
"relationshipType": {
|
|
67
|
-
"type": "object",
|
|
68
|
-
"description": "Definition of a single relationship type",
|
|
69
|
-
"properties": {
|
|
70
|
-
"id": {
|
|
71
|
-
"type": "string",
|
|
72
|
-
"pattern": "^[a-z][a-z0-9-]*$",
|
|
73
|
-
"description": "Unique identifier for the relationship (kebab-case)"
|
|
74
|
-
},
|
|
75
|
-
"predicate": {
|
|
76
|
-
"type": "string",
|
|
77
|
-
"pattern": "^[a-z][a-z0-9-]*$",
|
|
78
|
-
"description": "Forward direction predicate (kebab-case verb phrase)"
|
|
79
|
-
},
|
|
80
|
-
"inversePredicate": {
|
|
81
|
-
"type": "string",
|
|
82
|
-
"pattern": "^[a-z][a-z0-9-]*$",
|
|
83
|
-
"description": "Inverse direction predicate (kebab-case passive phrase)"
|
|
84
|
-
},
|
|
85
|
-
"category": {
|
|
86
|
-
"type": "string",
|
|
87
|
-
"enum": [
|
|
88
|
-
"structural",
|
|
89
|
-
"behavioral",
|
|
90
|
-
"dependency",
|
|
91
|
-
"traceability",
|
|
92
|
-
"governance",
|
|
93
|
-
"apm",
|
|
94
|
-
"security",
|
|
95
|
-
"ux",
|
|
96
|
-
"data"
|
|
97
|
-
],
|
|
98
|
-
"description": "Relationship category"
|
|
99
|
-
},
|
|
100
|
-
"archimateAlignment": {
|
|
101
|
-
"type": ["string", "null"],
|
|
102
|
-
"enum": [
|
|
103
|
-
"Composition",
|
|
104
|
-
"Aggregation",
|
|
105
|
-
"Specialization",
|
|
106
|
-
"Realization",
|
|
107
|
-
"Assignment",
|
|
108
|
-
"Triggering",
|
|
109
|
-
"Flow",
|
|
110
|
-
"Serving",
|
|
111
|
-
"Access",
|
|
112
|
-
"Influence",
|
|
113
|
-
null
|
|
114
|
-
],
|
|
115
|
-
"description": "Corresponding ArchiMate 3.2 relationship type, if any"
|
|
116
|
-
},
|
|
117
|
-
"description": {
|
|
118
|
-
"type": "string",
|
|
119
|
-
"minLength": 10,
|
|
120
|
-
"description": "Clear, concise description of the relationship semantics"
|
|
121
|
-
},
|
|
122
|
-
"semantics": {
|
|
123
|
-
"$ref": "#/definitions/semantics"
|
|
124
|
-
},
|
|
125
|
-
"applicableLayers": {
|
|
126
|
-
"type": "array",
|
|
127
|
-
"items": {
|
|
128
|
-
"type": "string",
|
|
129
|
-
"pattern": "^\\d{2}$"
|
|
130
|
-
},
|
|
131
|
-
"minItems": 1,
|
|
132
|
-
"description": "Layer IDs where this relationship can be used (e.g., ['01', '02'])"
|
|
133
|
-
},
|
|
134
|
-
"fieldPaths": {
|
|
135
|
-
"type": "array",
|
|
136
|
-
"items": {
|
|
137
|
-
"type": "string",
|
|
138
|
-
"pattern": "^([a-z][a-zA-Z0-9]*\\.[a-z][a-z0-9-]*|x-[a-z][a-z0-9-]*)$"
|
|
139
|
-
},
|
|
140
|
-
"description": "Property paths that encode this relationship (e.g., 'motivation.supports-goals')"
|
|
141
|
-
},
|
|
142
|
-
"examples": {
|
|
143
|
-
"type": "array",
|
|
144
|
-
"items": {
|
|
145
|
-
"$ref": "#/definitions/example"
|
|
146
|
-
},
|
|
147
|
-
"minItems": 1,
|
|
148
|
-
"description": "Example usages of this relationship"
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
"required": [
|
|
152
|
-
"id",
|
|
153
|
-
"predicate",
|
|
154
|
-
"inversePredicate",
|
|
155
|
-
"category",
|
|
156
|
-
"description",
|
|
157
|
-
"semantics",
|
|
158
|
-
"applicableLayers",
|
|
159
|
-
"examples"
|
|
160
|
-
],
|
|
161
|
-
"additionalProperties": false
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
"type": "object",
|
|
166
|
-
"properties": {
|
|
167
|
-
"$schema": {
|
|
168
|
-
"type": "string",
|
|
169
|
-
"format": "uri"
|
|
170
|
-
},
|
|
171
|
-
"title": {
|
|
172
|
-
"type": "string"
|
|
173
|
-
},
|
|
174
|
-
"description": {
|
|
175
|
-
"type": "string"
|
|
176
|
-
},
|
|
177
|
-
"version": {
|
|
178
|
-
"type": "string",
|
|
179
|
-
"pattern": "^\\d+\\.\\d+\\.\\d+$"
|
|
180
|
-
},
|
|
181
|
-
"generatedBy": {
|
|
182
|
-
"type": "string"
|
|
183
|
-
},
|
|
184
|
-
"lastUpdated": {
|
|
185
|
-
"type": "string",
|
|
186
|
-
"format": "date"
|
|
187
|
-
},
|
|
188
|
-
"relationshipTypes": {
|
|
189
|
-
"type": "array",
|
|
190
|
-
"items": {
|
|
191
|
-
"$ref": "#/definitions/relationshipType"
|
|
192
|
-
},
|
|
193
|
-
"minItems": 1
|
|
194
|
-
},
|
|
195
|
-
"metadata": {
|
|
196
|
-
"type": "object",
|
|
197
|
-
"properties": {
|
|
198
|
-
"totalRelationships": {
|
|
199
|
-
"type": "integer",
|
|
200
|
-
"minimum": 0
|
|
201
|
-
},
|
|
202
|
-
"categoryCounts": {
|
|
203
|
-
"type": "object",
|
|
204
|
-
"additionalProperties": {
|
|
205
|
-
"type": "integer",
|
|
206
|
-
"minimum": 0
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
"archimateAligned": {
|
|
210
|
-
"type": "integer",
|
|
211
|
-
"minimum": 0
|
|
212
|
-
},
|
|
213
|
-
"documentationRoboticsExtensions": {
|
|
214
|
-
"type": "integer",
|
|
215
|
-
"minimum": 0
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
},
|
|
220
|
-
"required": ["$schema", "title", "description", "version", "relationshipTypes"]
|
|
221
|
-
}
|
package/dist/utils/model-path.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import fs from "node:fs/promises";
|
|
3
|
-
async function resolveModelRoot(opts) {
|
|
4
|
-
const cwd = opts?.cwd ? path.resolve(opts.cwd) : process.cwd(), input = opts?.modelPath ? path.resolve(cwd, opts.modelPath) : cwd, candidates = [];
|
|
5
|
-
if (input.endsWith("manifest.yaml") && candidates.push(input), candidates.push(path.join(input, "manifest.yaml")), candidates.push(path.join(input, "model", "manifest.yaml")), candidates.push(path.join(input, "documentation-robotics", "model", "manifest.yaml")), process.env.DR_MODEL_PATH) {
|
|
6
|
-
const envPath = path.resolve(process.env.DR_MODEL_PATH);
|
|
7
|
-
envPath.endsWith("manifest.yaml") ? candidates.unshift(envPath) : (candidates.unshift(path.join(envPath, "manifest.yaml")), candidates.unshift(path.join(envPath, "model", "manifest.yaml")));
|
|
8
|
-
}
|
|
9
|
-
for (const manifestPath of candidates)
|
|
10
|
-
try {
|
|
11
|
-
await fs.access(manifestPath);
|
|
12
|
-
const normalized = path.normalize(manifestPath);
|
|
13
|
-
let rootPath;
|
|
14
|
-
return normalized.endsWith(path.join("documentation-robotics", "model", "manifest.yaml")) ? rootPath = path.dirname(path.dirname(path.dirname(normalized))) : normalized.endsWith(path.join("model", "manifest.yaml")) ? rootPath = path.dirname(path.dirname(normalized)) : rootPath = path.dirname(normalized), { rootPath, manifestPath: normalized };
|
|
15
|
-
} catch {
|
|
16
|
-
}
|
|
17
|
-
throw new Error("Model not found. Provide --model <path> (directory containing documentation-robotics/model/manifest.yaml) or set DR_MODEL_PATH.");
|
|
18
|
-
}
|
|
19
|
-
export {
|
|
20
|
-
resolveModelRoot
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=model-path.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/utils/model-path.ts"],
|
|
4
|
-
"sourcesContent": ["import path from 'node:path'\nimport fs from 'node:fs/promises'\n\n/**\n * Resolve the model root directory and manifest path.\n * Supports both TS layout (root/model/manifest.yaml) and Python layout\n * (root/documentation-robotics/model/manifest.yaml).\n */\nexport async function resolveModelRoot(opts?: {\n modelPath?: string\n cwd?: string\n}): Promise<{ rootPath: string; manifestPath: string }> {\n const cwd = opts?.cwd ? path.resolve(opts.cwd) : process.cwd()\n const input = opts?.modelPath ? path.resolve(cwd, opts.modelPath) : cwd\n\n const candidates: string[] = []\n\n // If a manifest file is directly provided\n if (input.endsWith('manifest.yaml')) {\n candidates.push(input)\n }\n\n // If a model directory is provided\n candidates.push(path.join(input, 'manifest.yaml'))\n\n // TypeScript layout: <root>/model/manifest.yaml\n candidates.push(path.join(input, 'model', 'manifest.yaml'))\n\n // Python/TypeScript unified layout: <root>/documentation-robotics/model/manifest.yaml\n candidates.push(path.join(input, 'documentation-robotics', 'model', 'manifest.yaml'))\n\n // Optional override via env var (highest priority)\n if (process.env.DR_MODEL_PATH) {\n const envPath = path.resolve(process.env.DR_MODEL_PATH)\n if (envPath.endsWith('manifest.yaml')) {\n candidates.unshift(envPath)\n } else {\n candidates.unshift(path.join(envPath, 'manifest.yaml'))\n candidates.unshift(path.join(envPath, 'model', 'manifest.yaml'))\n }\n }\n\n for (const manifestPath of candidates) {\n try {\n await fs.access(manifestPath)\n const normalized = path.normalize(manifestPath)\n // rootPath is the parent of the model directory\n let rootPath: string\n if (normalized.endsWith(path.join('documentation-robotics', 'model', 'manifest.yaml'))) {\n // <root>/documentation-robotics/model/manifest.yaml -> <root>\n rootPath = path.dirname(path.dirname(path.dirname(normalized)))\n } else if (normalized.endsWith(path.join('model', 'manifest.yaml'))) {\n // <root>/model/manifest.yaml -> <root>\n rootPath = path.dirname(path.dirname(normalized))\n } else {\n // <root>/manifest.yaml -> <root>\n rootPath = path.dirname(normalized)\n }\n return { rootPath, manifestPath: normalized }\n } catch {\n // continue searching\n }\n }\n\n throw new Error(\n 'Model not found. Provide --model <path> (directory containing documentation-robotics/model/manifest.yaml) or set DR_MODEL_PATH.'\n )\n}\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,UAAU;AACjB,OAAO,QAAQ;AAOf,eAAsB,iBAAiB,MAGtC;AACC,QAAM,MAAM,MAAM,MAAM,KAAK,QAAQ,KAAK,GAAG,IAAI,QAAQ,IAAG,GACtD,QAAQ,MAAM,YAAY,KAAK,QAAQ,KAAK,KAAK,SAAS,IAAI,KAE9D,aAAuB,CAAA;AAiB7B,MAdI,MAAM,SAAS,eAAe,KAChC,WAAW,KAAK,KAAK,GAIvB,WAAW,KAAK,KAAK,KAAK,OAAO,eAAe,CAAC,GAGjD,WAAW,KAAK,KAAK,KAAK,OAAO,SAAS,eAAe,CAAC,GAG1D,WAAW,KAAK,KAAK,KAAK,OAAO,0BAA0B,SAAS,eAAe,CAAC,GAGhF,QAAQ,IAAI,eAAe;AAC7B,UAAM,UAAU,KAAK,QAAQ,QAAQ,IAAI,aAAa;AAClD,YAAQ,SAAS,eAAe,IAClC,WAAW,QAAQ,OAAO,KAE1B,WAAW,QAAQ,KAAK,KAAK,SAAS,eAAe,CAAC,GACtD,WAAW,QAAQ,KAAK,KAAK,SAAS,SAAS,eAAe,CAAC;EAEnE;AAEA,aAAW,gBAAgB;AACzB,QAAI;AACF,YAAM,GAAG,OAAO,YAAY;AAC5B,YAAM,aAAa,KAAK,UAAU,YAAY;AAE9C,UAAI;AACJ,aAAI,WAAW,SAAS,KAAK,KAAK,0BAA0B,SAAS,eAAe,CAAC,IAEnF,WAAW,KAAK,QAAQ,KAAK,QAAQ,KAAK,QAAQ,UAAU,CAAC,CAAC,IACrD,WAAW,SAAS,KAAK,KAAK,SAAS,eAAe,CAAC,IAEhE,WAAW,KAAK,QAAQ,KAAK,QAAQ,UAAU,CAAC,IAGhD,WAAW,KAAK,QAAQ,UAAU,GAE7B,EAAE,UAAU,cAAc,WAAU;IAC7C,QAAQ;IAER;AAGF,QAAM,IAAI,MACR,iIAAiI;AAErI;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,405 +0,0 @@
|
|
|
1
|
-
# Test Instrumentation Guide
|
|
2
|
-
|
|
3
|
-
This guide explains how to use the test instrumentation utilities to enable filtering and debugging test telemetry in observability platforms like SigNoz.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
Test instrumentation creates OpenTelemetry spans with test-specific attributes, allowing you to:
|
|
8
|
-
|
|
9
|
-
- **Filter test spans** in SigNoz by test name, suite, file, or project
|
|
10
|
-
- **View test results** (pass/fail/skip) as span attributes
|
|
11
|
-
- **Debug test failures** with error messages and stack traces in spans
|
|
12
|
-
- **Correlate tests with CLI commands** by tracing context propagation
|
|
13
|
-
|
|
14
|
-
## Architecture
|
|
15
|
-
|
|
16
|
-
### Span Hierarchy
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
test.file span (parent)
|
|
20
|
-
├── attributes:
|
|
21
|
-
│ ├── test.file: "tests/unit/example.test.ts"
|
|
22
|
-
│ ├── test.framework: "bun"
|
|
23
|
-
│ ├── dr.project.name: "my-project"
|
|
24
|
-
│
|
|
25
|
-
├── test.case span (child 1)
|
|
26
|
-
│ ├── attributes:
|
|
27
|
-
│ │ ├── test.name: "should validate input"
|
|
28
|
-
│ │ ├── test.suite: "ValidationTests"
|
|
29
|
-
│ │ ├── test.status: "pass"
|
|
30
|
-
│ │ ├── dr.project.name: "my-project"
|
|
31
|
-
│
|
|
32
|
-
└── test.case span (child 2)
|
|
33
|
-
├── attributes:
|
|
34
|
-
├── test.name: "should handle errors"
|
|
35
|
-
├── test.suite: "ValidationTests"
|
|
36
|
-
├── test.status: "fail"
|
|
37
|
-
├── test.error.message: "Expected string, got number"
|
|
38
|
-
├── test.error.stack: "Error: Expected string...\n at..."
|
|
39
|
-
├── dr.project.name: "my-project"
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### Span Attributes
|
|
43
|
-
|
|
44
|
-
#### File-Level Span (`test.file`)
|
|
45
|
-
|
|
46
|
-
| Attribute | Type | Example | Description |
|
|
47
|
-
|-----------|------|---------|-------------|
|
|
48
|
-
| `test.file` | string | `tests/unit/example.test.ts` | Path to the test file |
|
|
49
|
-
| `test.framework` | string | `bun` | Test framework being used |
|
|
50
|
-
| `dr.project.name` | string | `my-project` | Project name (inherited from resource) |
|
|
51
|
-
|
|
52
|
-
#### Test Case Span (`test.case`)
|
|
53
|
-
|
|
54
|
-
| Attribute | Type | Example | Description |
|
|
55
|
-
|-----------|------|---------|-------------|
|
|
56
|
-
| `test.name` | string | `should validate input` | Test case name |
|
|
57
|
-
| `test.suite` | string | `ValidationTests` | Describe block name (optional) |
|
|
58
|
-
| `test.file` | string | `tests/unit/example.test.ts` | Parent test file |
|
|
59
|
-
| `test.status` | string | `pass`, `fail`, `skip` | Test result status |
|
|
60
|
-
| `dr.project.name` | string | `my-project` | Project name (inherited from resource) |
|
|
61
|
-
|
|
62
|
-
#### Error Attributes (on failed tests)
|
|
63
|
-
|
|
64
|
-
| Attribute | Type | Example |
|
|
65
|
-
|-----------|------|---------|
|
|
66
|
-
| `test.error.message` | string | `Expected string, got number` |
|
|
67
|
-
| `test.error.stack` | string | `Error: Expected...\n at ...` |
|
|
68
|
-
|
|
69
|
-
## Basic Usage
|
|
70
|
-
|
|
71
|
-
### Setup: File-Level Span
|
|
72
|
-
|
|
73
|
-
Add this to the top of your test file to create a file-level span:
|
|
74
|
-
|
|
75
|
-
```typescript
|
|
76
|
-
import { describe, test, beforeAll, afterAll } from 'bun:test';
|
|
77
|
-
import {
|
|
78
|
-
startTestFileSpan,
|
|
79
|
-
endTestFileSpan,
|
|
80
|
-
instrumentTest,
|
|
81
|
-
} from '../../src/telemetry/test-instrumentation.js';
|
|
82
|
-
|
|
83
|
-
// Create file-level span at the beginning of tests
|
|
84
|
-
beforeAll(() => {
|
|
85
|
-
startTestFileSpan('tests/unit/my.test.ts');
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
// Clean up at the end of tests
|
|
89
|
-
afterAll(() => {
|
|
90
|
-
endTestFileSpan();
|
|
91
|
-
});
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### Simple Tests with Helper
|
|
95
|
-
|
|
96
|
-
Use `instrumentTest()` to wrap test functions:
|
|
97
|
-
|
|
98
|
-
```typescript
|
|
99
|
-
describe('ValidationTests', () => {
|
|
100
|
-
test(
|
|
101
|
-
'should validate positive numbers',
|
|
102
|
-
instrumentTest(
|
|
103
|
-
'should validate positive numbers',
|
|
104
|
-
async () => {
|
|
105
|
-
const isValid = (n: number) => n > 0;
|
|
106
|
-
expect(isValid(42)).toBe(true);
|
|
107
|
-
},
|
|
108
|
-
'ValidationTests'
|
|
109
|
-
)
|
|
110
|
-
);
|
|
111
|
-
});
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### Advanced: Manual Span Management
|
|
115
|
-
|
|
116
|
-
For complex tests, manage spans manually:
|
|
117
|
-
|
|
118
|
-
```typescript
|
|
119
|
-
import {
|
|
120
|
-
createTestCaseSpan,
|
|
121
|
-
recordTestResult,
|
|
122
|
-
} from '../../src/telemetry/test-instrumentation.js';
|
|
123
|
-
|
|
124
|
-
test('complex test', async () => {
|
|
125
|
-
const span = createTestCaseSpan('complex test', 'ComplexTests');
|
|
126
|
-
try {
|
|
127
|
-
// test code
|
|
128
|
-
recordTestResult(span, 'pass');
|
|
129
|
-
} catch (error) {
|
|
130
|
-
recordTestResult(span, 'fail', error as Error);
|
|
131
|
-
throw error; // Re-throw to fail the test
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### Using Helpers
|
|
137
|
-
|
|
138
|
-
Import the helper functions for cleaner setup:
|
|
139
|
-
|
|
140
|
-
```typescript
|
|
141
|
-
import { setupTestTelemetry } from '../../tests/helpers/test-instrumentation-helpers.js';
|
|
142
|
-
import { describe, test, beforeAll, afterAll } from 'bun:test';
|
|
143
|
-
|
|
144
|
-
const { beforeAll: setupTelemetry, afterAll: teardownTelemetry } =
|
|
145
|
-
setupTestTelemetry('tests/unit/my.test.ts');
|
|
146
|
-
|
|
147
|
-
beforeAll(setupTelemetry);
|
|
148
|
-
afterAll(teardownTelemetry);
|
|
149
|
-
|
|
150
|
-
describe('MyTests', () => {
|
|
151
|
-
test('my test', () => {
|
|
152
|
-
// test code
|
|
153
|
-
});
|
|
154
|
-
});
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
## Complete Example
|
|
158
|
-
|
|
159
|
-
```typescript
|
|
160
|
-
// tests/unit/example.test.ts
|
|
161
|
-
import { describe, test, beforeAll, afterAll, expect } from 'bun:test';
|
|
162
|
-
import {
|
|
163
|
-
startTestFileSpan,
|
|
164
|
-
endTestFileSpan,
|
|
165
|
-
instrumentTest,
|
|
166
|
-
} from '../../src/telemetry/test-instrumentation.js';
|
|
167
|
-
|
|
168
|
-
// File-level setup
|
|
169
|
-
beforeAll(() => {
|
|
170
|
-
startTestFileSpan('tests/unit/example.test.ts');
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
afterAll(() => {
|
|
174
|
-
endTestFileSpan();
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
describe('ValidationTests', () => {
|
|
178
|
-
test(
|
|
179
|
-
'should validate email',
|
|
180
|
-
instrumentTest(
|
|
181
|
-
'should validate email',
|
|
182
|
-
async () => {
|
|
183
|
-
const validateEmail = (email: string) => {
|
|
184
|
-
if (!email.includes('@')) throw new Error('Invalid email');
|
|
185
|
-
return true;
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
expect(validateEmail('user@example.com')).toBe(true);
|
|
189
|
-
expect(() => validateEmail('invalid')).toThrow('Invalid email');
|
|
190
|
-
},
|
|
191
|
-
'ValidationTests'
|
|
192
|
-
)
|
|
193
|
-
);
|
|
194
|
-
|
|
195
|
-
test(
|
|
196
|
-
'should handle edge cases',
|
|
197
|
-
instrumentTest(
|
|
198
|
-
'should handle edge cases',
|
|
199
|
-
async () => {
|
|
200
|
-
const isEmpty = (s: string) => s.length === 0;
|
|
201
|
-
expect(isEmpty('')).toBe(true);
|
|
202
|
-
expect(isEmpty('a')).toBe(false);
|
|
203
|
-
},
|
|
204
|
-
'ValidationTests'
|
|
205
|
-
)
|
|
206
|
-
);
|
|
207
|
-
});
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
## Telemetry Flow
|
|
211
|
-
|
|
212
|
-
When telemetry is enabled (`TELEMETRY_ENABLED=true`):
|
|
213
|
-
|
|
214
|
-
1. **Test file starts** → `startTestFileSpan()` creates parent span
|
|
215
|
-
2. **Each test runs** → `instrumentTest()` wraps test function
|
|
216
|
-
3. **Test span created** → Child span with `test.name`, `test.suite`
|
|
217
|
-
4. **Test completes** → `recordTestResult()` sets `test.status`
|
|
218
|
-
5. **On failure** → Error attributes (`test.error.message`, `test.error.stack`) added
|
|
219
|
-
6. **Span exported** → SimpleSpanProcessor sends to OTLP collector
|
|
220
|
-
7. **Test file ends** → `endTestFileSpan()` closes parent span
|
|
221
|
-
|
|
222
|
-
### Export Endpoint
|
|
223
|
-
|
|
224
|
-
By default, spans are sent to:
|
|
225
|
-
```
|
|
226
|
-
http://localhost:4318/v1/traces
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
Configure via environment variables:
|
|
230
|
-
```bash
|
|
231
|
-
OTEL_EXPORTER_OTLP_ENDPOINT=http://your-collector:4318
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
## SigNoz Integration
|
|
235
|
-
|
|
236
|
-
### Viewing Test Spans
|
|
237
|
-
|
|
238
|
-
1. Open SigNoz dashboard
|
|
239
|
-
2. Go to **Traces** section
|
|
240
|
-
3. Filter by attributes:
|
|
241
|
-
```
|
|
242
|
-
dr.project.name = "my-project"
|
|
243
|
-
test.framework = "bun"
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
### Query Examples
|
|
247
|
-
|
|
248
|
-
**Find all failed tests:**
|
|
249
|
-
```
|
|
250
|
-
test.status = "fail"
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
**Find tests in a specific file:**
|
|
254
|
-
```
|
|
255
|
-
test.file = "tests/unit/example.test.ts"
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
**Find tests in a suite:**
|
|
259
|
-
```
|
|
260
|
-
test.suite = "ValidationTests"
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
**Find tests with errors matching pattern:**
|
|
264
|
-
```
|
|
265
|
-
test.error.message LIKE "%assertion%"
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
### Viewing Error Details
|
|
269
|
-
|
|
270
|
-
Click a failed test span to see:
|
|
271
|
-
- `test.error.message` - Error message
|
|
272
|
-
- `test.error.stack` - Full stack trace
|
|
273
|
-
- Exception record with full error context
|
|
274
|
-
|
|
275
|
-
## Performance Considerations
|
|
276
|
-
|
|
277
|
-
### Production Mode
|
|
278
|
-
|
|
279
|
-
In production builds, `TELEMETRY_ENABLED=false` and all instrumentation becomes zero-cost:
|
|
280
|
-
|
|
281
|
-
```typescript
|
|
282
|
-
// Compiled out in production
|
|
283
|
-
if (TELEMETRY_ENABLED) {
|
|
284
|
-
const span = startTestFileSpan('...'); // → Eliminated
|
|
285
|
-
}
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
### Debug Mode
|
|
289
|
-
|
|
290
|
-
In debug mode, overhead is minimal:
|
|
291
|
-
- File span: ~1ms overhead per test file
|
|
292
|
-
- Test span: ~0.1ms overhead per test case
|
|
293
|
-
- Exporter timeout: 500ms (non-blocking, happens in background)
|
|
294
|
-
|
|
295
|
-
### Circuit-Breaker Protection
|
|
296
|
-
|
|
297
|
-
If the OTLP collector is unreachable:
|
|
298
|
-
1. First export attempt fails with 500ms timeout
|
|
299
|
-
2. Circuit-breaker activates for 30 seconds
|
|
300
|
-
3. Spans discarded silently (no CLI impact)
|
|
301
|
-
4. After 30s, collector connection retried
|
|
302
|
-
|
|
303
|
-
## Troubleshooting
|
|
304
|
-
|
|
305
|
-
### Spans Not Appearing in SigNoz
|
|
306
|
-
|
|
307
|
-
1. **Check collector is running:**
|
|
308
|
-
```bash
|
|
309
|
-
curl http://localhost:4318/v1/traces
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
2. **Verify telemetry is enabled:**
|
|
313
|
-
- Debug build should have `TELEMETRY_ENABLED=true`
|
|
314
|
-
- Check CLI log output for telemetry initialization
|
|
315
|
-
|
|
316
|
-
3. **Check resource attributes:**
|
|
317
|
-
- In SigNoz, look for spans with `service.name=dr-cli`
|
|
318
|
-
- Filter by `dr.project.name` to verify project context
|
|
319
|
-
|
|
320
|
-
### Empty `test.suite` Attribute
|
|
321
|
-
|
|
322
|
-
If `test.suite` is empty string:
|
|
323
|
-
- Means the optional `suiteName` parameter wasn't provided
|
|
324
|
-
- This is fine - tests are still tracked by `test.name`
|
|
325
|
-
|
|
326
|
-
### Stack Traces Not Visible
|
|
327
|
-
|
|
328
|
-
- Verify error has `stack` property
|
|
329
|
-
- Check `test.error.stack` attribute in span
|
|
330
|
-
- Very old Error objects may not have stack traces
|
|
331
|
-
|
|
332
|
-
## Integration with Manifest
|
|
333
|
-
|
|
334
|
-
Test spans automatically include the project name from your model manifest:
|
|
335
|
-
|
|
336
|
-
```json
|
|
337
|
-
// .dr/manifest.json
|
|
338
|
-
{
|
|
339
|
-
"name": "my-project",
|
|
340
|
-
"version": "1.0.0"
|
|
341
|
-
}
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
This becomes the `dr.project.name` attribute on all test spans, enabling filtering by project.
|
|
345
|
-
|
|
346
|
-
## Best Practices
|
|
347
|
-
|
|
348
|
-
1. **Always set up file span** - Use `beforeAll`/`afterAll` hooks
|
|
349
|
-
2. **Use suite names** - Help organize tests in SigNoz
|
|
350
|
-
3. **Let errors bubble** - Re-throw after `recordTestResult(span, 'fail', error)`
|
|
351
|
-
4. **Consistent naming** - Use readable test names for better filtering
|
|
352
|
-
5. **Group related tests** - Use describe blocks with suite names
|
|
353
|
-
|
|
354
|
-
## API Reference
|
|
355
|
-
|
|
356
|
-
### `startTestFileSpan(filePath: string): Span | null`
|
|
357
|
-
|
|
358
|
-
Creates a file-level span for the test file.
|
|
359
|
-
|
|
360
|
-
- **Returns:** Span object (or null if telemetry disabled)
|
|
361
|
-
- **Call:** In `beforeAll()` hook
|
|
362
|
-
|
|
363
|
-
### `endTestFileSpan(): void`
|
|
364
|
-
|
|
365
|
-
Ends the file-level span and cleans up context.
|
|
366
|
-
|
|
367
|
-
- **Call:** In `afterAll()` hook
|
|
368
|
-
|
|
369
|
-
### `createTestCaseSpan(testName: string, suiteName?: string): Span | null`
|
|
370
|
-
|
|
371
|
-
Creates a span for a test case.
|
|
372
|
-
|
|
373
|
-
- **Parameters:**
|
|
374
|
-
- `testName`: Name of the test case
|
|
375
|
-
- `suiteName`: Optional describe block name
|
|
376
|
-
- **Returns:** Span object (or null if telemetry disabled)
|
|
377
|
-
|
|
378
|
-
### `recordTestResult(span: Span | null, status: 'pass' | 'fail' | 'skip', error?: Error): void`
|
|
379
|
-
|
|
380
|
-
Records test result and ends the span.
|
|
381
|
-
|
|
382
|
-
- **Parameters:**
|
|
383
|
-
- `span`: Test case span (from `createTestCaseSpan`)
|
|
384
|
-
- `status`: Test result
|
|
385
|
-
- `error`: Optional Error object for failed tests
|
|
386
|
-
- **Effect:** Sets attributes and ends span
|
|
387
|
-
|
|
388
|
-
### `instrumentTest(testName: string, testFn: () => void | Promise<void>, suiteName?: string): () => Promise<void>`
|
|
389
|
-
|
|
390
|
-
Wraps a test function with automatic instrumentation.
|
|
391
|
-
|
|
392
|
-
- **Parameters:**
|
|
393
|
-
- `testName`: Name of the test
|
|
394
|
-
- `testFn`: Test function (sync or async)
|
|
395
|
-
- `suiteName`: Optional describe block name
|
|
396
|
-
- **Returns:** Wrapped async function for use with `test()`
|
|
397
|
-
- **Behavior:** Automatically creates span, executes test, records result
|
|
398
|
-
|
|
399
|
-
## Examples
|
|
400
|
-
|
|
401
|
-
See the following files for complete examples:
|
|
402
|
-
|
|
403
|
-
- `tests/unit/test-instrumentation.example.test.ts` - Basic usage examples
|
|
404
|
-
- `tests/unit/test-instrumentation.test.ts` - Unit tests for instrumentation
|
|
405
|
-
- `tests/unit/test-instrumentation-integration.test.ts` - Integration examples
|