@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
package/docs/telemetry.md
DELETED
|
@@ -1,427 +0,0 @@
|
|
|
1
|
-
# Telemetry Verification and Implementation Guide
|
|
2
|
-
|
|
3
|
-
This document provides a comprehensive guide to verifying the complete telemetry pipeline implementation for the Documentation Robotics CLI. All components have been implemented and are ready for verification.
|
|
4
|
-
|
|
5
|
-
## Implementation Summary
|
|
6
|
-
|
|
7
|
-
### What Has Been Implemented
|
|
8
|
-
|
|
9
|
-
#### 1. Core Telemetry Infrastructure
|
|
10
|
-
|
|
11
|
-
- **`telemetry/index.ts`**: Main module providing:
|
|
12
|
-
- OpenTelemetry SDK initialization with project name context from manifest
|
|
13
|
-
- Span creation and management utilities (`startSpan()`, `endSpan()`)
|
|
14
|
-
- Log emission with trace context correlation (`emitLog()`)
|
|
15
|
-
- Graceful shutdown (`shutdownTelemetry()`)
|
|
16
|
-
- Resource attributes including `dr.project.name` for all traces and logs
|
|
17
|
-
|
|
18
|
-
- **`telemetry/resilient-exporter.ts`**: Circuit-breaker pattern for trace export
|
|
19
|
-
- 500ms timeout to prevent blocking CLI execution
|
|
20
|
-
- 30-second backoff on failure
|
|
21
|
-
- Graceful degradation when OTLP collector is unavailable
|
|
22
|
-
|
|
23
|
-
- **`telemetry/resilient-log-exporter.ts`**: Circuit-breaker pattern for log export
|
|
24
|
-
- Mirrors resilient trace exporter design
|
|
25
|
-
- Independent log pipeline with same protection
|
|
26
|
-
|
|
27
|
-
#### 2. Console Integration
|
|
28
|
-
|
|
29
|
-
- **`telemetry/console-interceptor.ts`**: Automatic console capture
|
|
30
|
-
- Intercepts `console.log()` → INFO severity
|
|
31
|
-
- Intercepts `console.error()` → ERROR severity with stack traces
|
|
32
|
-
- Intercepts `console.warn()` → WARN severity
|
|
33
|
-
- Intercepts `console.debug()` → DEBUG severity
|
|
34
|
-
- Preserves original console behavior (output still appears)
|
|
35
|
-
- All logs correlated to active trace context
|
|
36
|
-
|
|
37
|
-
#### 3. Test Instrumentation
|
|
38
|
-
|
|
39
|
-
- **`telemetry/test-instrumentation.ts`**: Test span creation utilities
|
|
40
|
-
- `startTestFileSpan(filePath)`: Creates file-level span with `test.file` and `test.framework` attributes
|
|
41
|
-
- `createTestCaseSpan(testName, suiteName)`: Creates test case span with standard attributes
|
|
42
|
-
- `recordTestResult(span, status, error)`: Records test status and errors
|
|
43
|
-
- `instrumentTest(testName, testFn, suiteName)`: Helper wrapper for automatic span management
|
|
44
|
-
|
|
45
|
-
- **`tests/unit/test-instrumentation.example.test.ts`**: Comprehensive example showing all features
|
|
46
|
-
|
|
47
|
-
#### 4. CLI Root Instrumentation
|
|
48
|
-
|
|
49
|
-
- **`cli.ts`**: Span instrumentation for every command
|
|
50
|
-
- Root span `cli.execute` created in `preAction` hook
|
|
51
|
-
- Span attributes: `command`, `args`, `cwd`, `version`
|
|
52
|
-
- Proper error recording with `recordException()`
|
|
53
|
-
- Graceful shutdown in both `beforeExit` and `exit` handlers
|
|
54
|
-
|
|
55
|
-
#### 5. Validator Instrumentation
|
|
56
|
-
|
|
57
|
-
- **`validators/validator.ts`**: Nested span structure
|
|
58
|
-
- Root span: `model.validate`
|
|
59
|
-
- Child spans:
|
|
60
|
-
- `validation.stage.schema`: Schema validation
|
|
61
|
-
- `validation.stage.naming`: Naming convention validation
|
|
62
|
-
- `validation.stage.reference`: Cross-layer reference validation
|
|
63
|
-
- `validation.stage.semantic`: Business rule validation
|
|
64
|
-
|
|
65
|
-
#### 6. Build Configuration
|
|
66
|
-
|
|
67
|
-
- **`esbuild.config.js`**: Compile-time telemetry control
|
|
68
|
-
- `TELEMETRY_ENABLED` constant set by `DR_TELEMETRY` environment variable
|
|
69
|
-
- Dead-code elimination removes all telemetry from production builds
|
|
70
|
-
- Debug build: `npm run build:debug` (with telemetry enabled)
|
|
71
|
-
- Production build: `npm run build` (zero overhead)
|
|
72
|
-
|
|
73
|
-
#### 7. Project Name Integration
|
|
74
|
-
|
|
75
|
-
- **Project context propagation** via manifest loading
|
|
76
|
-
- Attempts to load `.dr/manifest.json` at initialization
|
|
77
|
-
- Falls back to `'unknown'` if no manifest exists (e.g., during `dr init`)
|
|
78
|
-
- Stored as resource attribute `dr.project.name`
|
|
79
|
-
- Automatically included in all traces and logs
|
|
80
|
-
|
|
81
|
-
## Verification Checklist
|
|
82
|
-
|
|
83
|
-
### Phase 1: Build and Setup
|
|
84
|
-
|
|
85
|
-
- [ ] **Build debug CLI**:
|
|
86
|
-
```bash
|
|
87
|
-
cd /workspace/cli
|
|
88
|
-
npm run build:debug
|
|
89
|
-
```
|
|
90
|
-
Expected: No errors, telemetry enabled in output
|
|
91
|
-
|
|
92
|
-
- [ ] **Verify build artifacts**:
|
|
93
|
-
```bash
|
|
94
|
-
ls -la dist/cli.js
|
|
95
|
-
# Approximately 400-500KB (with telemetry)
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
- [ ] **Verify development build has telemetry**:
|
|
99
|
-
```bash
|
|
100
|
-
npm run build
|
|
101
|
-
ls -la dist/cli.js
|
|
102
|
-
# Approximately 300-400KB (without telemetry)
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
### Phase 2: Project Name Propagation
|
|
106
|
-
|
|
107
|
-
- [ ] **Create test model**:
|
|
108
|
-
```bash
|
|
109
|
-
cd /tmp && rm -rf test-model && mkdir test-model && cd test-model
|
|
110
|
-
/workspace/cli/dist/cli.js init --name "VerificationModel"
|
|
111
|
-
cat .dr/manifest.json | grep '"name"'
|
|
112
|
-
```
|
|
113
|
-
Expected: `"name": "VerificationModel"`
|
|
114
|
-
|
|
115
|
-
- [ ] **Verify project name loading**:
|
|
116
|
-
```bash
|
|
117
|
-
/workspace/cli/dist/cli.js validate
|
|
118
|
-
```
|
|
119
|
-
When telemetry is enabled, traces will include `dr.project.name: "VerificationModel"`
|
|
120
|
-
|
|
121
|
-
### Phase 3: Console Logging Verification
|
|
122
|
-
|
|
123
|
-
- [ ] **Run validator to see console output**:
|
|
124
|
-
```bash
|
|
125
|
-
cd /tmp/test-model
|
|
126
|
-
/workspace/cli/dist/cli.js validate
|
|
127
|
-
```
|
|
128
|
-
Expected output includes validation messages like:
|
|
129
|
-
```
|
|
130
|
-
✓ Schema validation passed
|
|
131
|
-
✓ Naming validation passed
|
|
132
|
-
✓ Reference validation passed
|
|
133
|
-
✓ Semantic validation passed
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
- [ ] **Test error logging**:
|
|
137
|
-
```bash
|
|
138
|
-
# Create an invalid element to trigger errors
|
|
139
|
-
/workspace/cli/dist/cli.js add invalid-layer invalid-type test-element
|
|
140
|
-
```
|
|
141
|
-
Expected: Error messages appear in console (and would be captured as ERROR level logs)
|
|
142
|
-
|
|
143
|
-
### Phase 4: Span Nesting Verification
|
|
144
|
-
|
|
145
|
-
- [ ] **Inspect CLI span in code**:
|
|
146
|
-
```bash
|
|
147
|
-
grep -n "startSpan('cli.execute'" /workspace/cli/src/cli.ts
|
|
148
|
-
```
|
|
149
|
-
Expected: Found at line ~69
|
|
150
|
-
|
|
151
|
-
- [ ] **Inspect validator spans in code**:
|
|
152
|
-
```bash
|
|
153
|
-
grep -n "startSpan('model.validate'" /workspace/cli/src/validators/validator.ts
|
|
154
|
-
grep -n "startSpan('validation.stage" /workspace/cli/src/validators/validator.ts
|
|
155
|
-
```
|
|
156
|
-
Expected: Multiple stages found with proper nesting
|
|
157
|
-
|
|
158
|
-
### Phase 5: Test Instrumentation Verification
|
|
159
|
-
|
|
160
|
-
- [ ] **Review example test file**:
|
|
161
|
-
```bash
|
|
162
|
-
head -100 /workspace/cli/tests/unit/test-instrumentation.example.test.ts
|
|
163
|
-
```
|
|
164
|
-
Expected: Shows `beforeAll()`, `afterAll()`, `instrumentTest()` usage
|
|
165
|
-
|
|
166
|
-
- [ ] **Run unit tests**:
|
|
167
|
-
```bash
|
|
168
|
-
cd /workspace/cli
|
|
169
|
-
npm run test:unit
|
|
170
|
-
```
|
|
171
|
-
Expected: All tests pass (100+ test files)
|
|
172
|
-
|
|
173
|
-
### Phase 6: Circuit-Breaker Verification
|
|
174
|
-
|
|
175
|
-
- [ ] **Verify circuit-breaker code**:
|
|
176
|
-
```bash
|
|
177
|
-
grep -A5 "retryAfter =" /workspace/cli/src/telemetry/resilient-exporter.ts
|
|
178
|
-
```
|
|
179
|
-
Expected: Circuit-breaker logic present with 30s backoff
|
|
180
|
-
|
|
181
|
-
- [ ] **Verify graceful handling**:
|
|
182
|
-
```bash
|
|
183
|
-
# When OTEL collector is unavailable, this command completes successfully
|
|
184
|
-
# with no user-visible errors or blocking
|
|
185
|
-
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:9999 \
|
|
186
|
-
/workspace/cli/dist/cli.js validate
|
|
187
|
-
```
|
|
188
|
-
Expected: Command completes in <2 seconds, no error output
|
|
189
|
-
|
|
190
|
-
## Detailed Verification Instructions
|
|
191
|
-
|
|
192
|
-
### SigNoz Stack Setup (Optional)
|
|
193
|
-
|
|
194
|
-
If you want to fully verify the telemetry pipeline with SigNoz:
|
|
195
|
-
|
|
196
|
-
1. **Prerequisites**:
|
|
197
|
-
- Docker and Docker Compose installed
|
|
198
|
-
- At least 4GB free disk space
|
|
199
|
-
|
|
200
|
-
2. **Start SigNoz** (using the example configuration):
|
|
201
|
-
```bash
|
|
202
|
-
cd /workspace
|
|
203
|
-
./docs/otel_example/signoz-stack.sh start
|
|
204
|
-
# Wait ~30 seconds for services to initialize
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
**Note:** This uses the example SigNoz stack in `docs/otel_example/`. You can also use your own OTEL collector.
|
|
208
|
-
|
|
209
|
-
3. **Access SigNoz UI**:
|
|
210
|
-
- Open http://localhost:3301 in your browser
|
|
211
|
-
- Dashboard should load with no errors
|
|
212
|
-
|
|
213
|
-
4. **Send telemetry**:
|
|
214
|
-
```bash
|
|
215
|
-
cd /tmp/test-model
|
|
216
|
-
npm run build:debug # In CLI directory
|
|
217
|
-
node /workspace/cli/dist/cli.js validate
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
5. **Verify in SigNoz**:
|
|
221
|
-
- Navigate to Traces section
|
|
222
|
-
- Look for spans named `cli.execute`
|
|
223
|
-
- Expand to see nested `validation.stage.*` spans
|
|
224
|
-
- Click on a span to see attributes and logs
|
|
225
|
-
|
|
226
|
-
6. **Filter by project**:
|
|
227
|
-
- Use filter: `dr.project.name = "VerificationModel"`
|
|
228
|
-
- Should show only traces from your test model
|
|
229
|
-
|
|
230
|
-
7. **View logs**:
|
|
231
|
-
- Click on a span
|
|
232
|
-
- Switch to "Logs" tab
|
|
233
|
-
- Console output should appear with correlation IDs
|
|
234
|
-
|
|
235
|
-
8. **Stop SigNoz** (if using the example stack):
|
|
236
|
-
```bash
|
|
237
|
-
./docs/otel_example/signoz-stack.sh stop
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
## Architecture Overview
|
|
241
|
-
|
|
242
|
-
```
|
|
243
|
-
┌─────────────────────────────────────────────────────────┐
|
|
244
|
-
│ CLI Execution │
|
|
245
|
-
├─────────────────────────────────────────────────────────┤
|
|
246
|
-
│ │
|
|
247
|
-
│ ┌─────────────────────────────────────────────────┐ │
|
|
248
|
-
│ │ cli.execute (root span) │ │
|
|
249
|
-
│ │ ├─ command: validate │ │
|
|
250
|
-
│ │ ├─ args: --verbose │ │
|
|
251
|
-
│ │ ├─ cwd: /tmp/test-model │ │
|
|
252
|
-
│ │ ├─ dr.project.name: VerificationModel │ │
|
|
253
|
-
│ │ │ │ │
|
|
254
|
-
│ │ └──┬─────────────────────────────────────────┐ │ │
|
|
255
|
-
│ │ │ model.validate (validator root) │ │ │
|
|
256
|
-
│ │ │ ├─ validation.stage.schema │ │ │
|
|
257
|
-
│ │ │ │ └─ Logs: "Schema validation passed" │ │ │
|
|
258
|
-
│ │ │ ├─ validation.stage.naming │ │ │
|
|
259
|
-
│ │ │ │ └─ Logs: "Naming validation passed" │ │ │
|
|
260
|
-
│ │ │ ├─ validation.stage.reference │ │ │
|
|
261
|
-
│ │ │ │ └─ Logs: "Reference validation..." │ │ │
|
|
262
|
-
│ │ │ └─ validation.stage.semantic │ │ │
|
|
263
|
-
│ │ │ └─ Logs: "Semantic validation..." │ │ │
|
|
264
|
-
│ │ └─────────────────────────────────────────┘ │ │
|
|
265
|
-
│ │ │ │
|
|
266
|
-
│ │ Logs: │ │
|
|
267
|
-
│ │ ├─ traceId: abc123xyz... │ │
|
|
268
|
-
│ │ ├─ spanId: def456... │ │
|
|
269
|
-
│ │ └─ Console output captured here │ │
|
|
270
|
-
│ └─────────────────────────────────────────────────┘ │
|
|
271
|
-
│ │ │
|
|
272
|
-
│ ▼ │
|
|
273
|
-
│ ┌──────────────────────────────────┐ │
|
|
274
|
-
│ │ Console Interceptor │ │
|
|
275
|
-
│ │ ├─ console.log → INFO │ │
|
|
276
|
-
│ │ ├─ console.error → ERROR │ │
|
|
277
|
-
│ │ └─ Preserves original output │ │
|
|
278
|
-
│ └──────────────────────────────────┘ │
|
|
279
|
-
│ │ │
|
|
280
|
-
└──────────────────────┼──────────────────────────────────┘
|
|
281
|
-
│
|
|
282
|
-
┌─────────────┴──────────────┐
|
|
283
|
-
▼ ▼
|
|
284
|
-
┌──────────────┐ ┌──────────────┐
|
|
285
|
-
│ Trace Export │ │ Log Export │
|
|
286
|
-
│ (OTLP) │ │ (OTLP) │
|
|
287
|
-
│ /v1/traces │ │ /v1/logs │
|
|
288
|
-
└──────┬───────┘ └──────┬───────┘
|
|
289
|
-
│ │
|
|
290
|
-
└────────┬────────────────┘
|
|
291
|
-
│
|
|
292
|
-
▼
|
|
293
|
-
┌──────────────────────┐
|
|
294
|
-
│ OTEL Collector │
|
|
295
|
-
│ localhost:4318 │
|
|
296
|
-
└──────────┬───────────┘
|
|
297
|
-
│
|
|
298
|
-
▼
|
|
299
|
-
┌──────────────────────┐
|
|
300
|
-
│ SigNoz │
|
|
301
|
-
│ localhost:3301 │
|
|
302
|
-
└──────────────────────┘
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
## Key Features Verified
|
|
306
|
-
|
|
307
|
-
### Feature 1: CLI Command Tracing
|
|
308
|
-
- **Status**: ✅ Implemented
|
|
309
|
-
- **Location**: `cli.ts:69` - Root span creation
|
|
310
|
-
- **Verification**: Run any command and check for `cli.execute` span
|
|
311
|
-
- **Attributes**: command, args, cwd, version, dr.project.name
|
|
312
|
-
|
|
313
|
-
### Feature 2: Console Log Correlation
|
|
314
|
-
- **Status**: ✅ Implemented
|
|
315
|
-
- **Location**: `console-interceptor.ts` - All console methods wrapped
|
|
316
|
-
- **Verification**: Run validator and check logs appear with traceId/spanId
|
|
317
|
-
- **Severity Mapping**: log→INFO, error→ERROR, warn→WARN, debug→DEBUG
|
|
318
|
-
|
|
319
|
-
### Feature 3: Validator Span Nesting
|
|
320
|
-
- **Status**: ✅ Implemented
|
|
321
|
-
- **Location**: `validator.ts:41-111` - All stages instrumented
|
|
322
|
-
- **Verification**: Expand validator spans to see nested stages
|
|
323
|
-
- **Stages**: schema, naming, reference, semantic
|
|
324
|
-
|
|
325
|
-
### Feature 4: Test File Spans
|
|
326
|
-
- **Status**: ✅ Implemented
|
|
327
|
-
- **Location**: `test-instrumentation.ts:58-70` - File span creation
|
|
328
|
-
- **Verification**: Run instrumented test and check for `test.file` attribute
|
|
329
|
-
- **Attributes**: test.file, test.framework=bun
|
|
330
|
-
|
|
331
|
-
### Feature 5: Test Case Spans
|
|
332
|
-
- **Status**: ✅ Implemented
|
|
333
|
-
- **Location**: `test-instrumentation.ts:113-127` - Case span creation
|
|
334
|
-
- **Verification**: Check span for test.name, test.suite, test.status attributes
|
|
335
|
-
- **Error Recording**: test.error.message and test.error.stack for failures
|
|
336
|
-
|
|
337
|
-
### Feature 6: Failed Test Error Reporting
|
|
338
|
-
- **Status**: ✅ Implemented
|
|
339
|
-
- **Location**: `test-instrumentation.ts:153-166` - Error attribute setting
|
|
340
|
-
- **Verification**: Fail a test and check for test.status=fail and error attributes
|
|
341
|
-
- **Stack Traces**: Captured via span.recordException()
|
|
342
|
-
|
|
343
|
-
### Feature 7: Log-Test Correlation
|
|
344
|
-
- **Status**: ✅ Implemented via console interceptor
|
|
345
|
-
- **Location**: `console-interceptor.ts` + `test-instrumentation.ts`
|
|
346
|
-
- **Verification**: Console output during tests appears in test span logs
|
|
347
|
-
- **Mechanism**: Automatic trace context propagation
|
|
348
|
-
|
|
349
|
-
### Feature 8: Circuit-Breaker Protection
|
|
350
|
-
- **Status**: ✅ Implemented
|
|
351
|
-
- **Location**: `resilient-exporter.ts`, `resilient-log-exporter.ts`
|
|
352
|
-
- **Verification**: Block collector and run command → completes normally, no errors
|
|
353
|
-
- **Backoff**: 30 seconds after failure
|
|
354
|
-
|
|
355
|
-
### Feature 9: Project Name Propagation
|
|
356
|
-
- **Status**: ✅ Implemented
|
|
357
|
-
- **Location**: `telemetry/index.ts:74-90` - Manifest loading
|
|
358
|
-
- **Verification**: All spans/logs include `dr.project.name` attribute
|
|
359
|
-
- **Fallback**: Uses 'unknown' if no manifest exists
|
|
360
|
-
|
|
361
|
-
## Test Coverage Summary
|
|
362
|
-
|
|
363
|
-
```
|
|
364
|
-
Unit Tests: 421 pass, 0 fail
|
|
365
|
-
|
|
366
|
-
Breakdown by module:
|
|
367
|
-
- Telemetry module: 30 tests
|
|
368
|
-
- Console interceptor: 50+ tests
|
|
369
|
-
- Test instrumentation: 30+ tests
|
|
370
|
-
- CLI instrumentation: 40+ tests
|
|
371
|
-
- Other modules: 270+ tests
|
|
372
|
-
|
|
373
|
-
All tests verify:
|
|
374
|
-
✅ No-op behavior when disabled
|
|
375
|
-
✅ Proper span creation and attributes
|
|
376
|
-
✅ Error recording and exception propagation
|
|
377
|
-
✅ Console method wrapping
|
|
378
|
-
✅ Trace context propagation
|
|
379
|
-
✅ Circuit-breaker activation
|
|
380
|
-
```
|
|
381
|
-
|
|
382
|
-
## Next Steps
|
|
383
|
-
|
|
384
|
-
1. **Verify with SigNoz** (optional but recommended):
|
|
385
|
-
- Follow the SigNoz stack setup instructions above
|
|
386
|
-
- Observe actual trace-log correlation in the UI
|
|
387
|
-
|
|
388
|
-
2. **Run comprehensive tests**:
|
|
389
|
-
```bash
|
|
390
|
-
cd /workspace/cli
|
|
391
|
-
npm run test
|
|
392
|
-
```
|
|
393
|
-
|
|
394
|
-
3. **Test with your own models**:
|
|
395
|
-
- Create a test model: `dr init --name "MyProject"`
|
|
396
|
-
- Run commands with telemetry: `node dist/cli.js validate`
|
|
397
|
-
- Verify project name appears in traces
|
|
398
|
-
|
|
399
|
-
4. **Review documentation**:
|
|
400
|
-
- Check `/workspace/cli/README.md` Telemetry section
|
|
401
|
-
- Verify setup instructions are clear
|
|
402
|
-
- Check troubleshooting section
|
|
403
|
-
|
|
404
|
-
5. **Integrate with CI/CD** (optional):
|
|
405
|
-
- Debug builds can send telemetry to shared collector
|
|
406
|
-
- Filter traces by project name and CI/CD pipeline ID
|
|
407
|
-
- Monitor CLI reliability across different environments
|
|
408
|
-
|
|
409
|
-
## Troubleshooting Reference
|
|
410
|
-
|
|
411
|
-
See `/workspace/cli/README.md` "Telemetry & Observability" section for:
|
|
412
|
-
- Common setup issues
|
|
413
|
-
- Circuit-breaker behavior
|
|
414
|
-
- Resource attribute verification
|
|
415
|
-
- Log level mapping
|
|
416
|
-
- Production vs. debug build differences
|
|
417
|
-
|
|
418
|
-
## Summary
|
|
419
|
-
|
|
420
|
-
All requirements have been implemented with:
|
|
421
|
-
- Zero production overhead (telemetry disabled by default)
|
|
422
|
-
- Comprehensive error handling
|
|
423
|
-
- Graceful degradation
|
|
424
|
-
- Full trace-log correlation
|
|
425
|
-
- Project-level filtering capability
|
|
426
|
-
|
|
427
|
-
Ready for integration and deployment.
|
package/test-debug.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
const { PlantUMLExporter } = require('./dist/export/plantuml-exporter.js');
|
|
2
|
-
const { Model } = require('./dist/core/model.js');
|
|
3
|
-
const { Layer } = require('./dist/core/layer.js');
|
|
4
|
-
const { Element } = require('./dist/core/element.js');
|
|
5
|
-
const { Manifest } = require('./dist/core/manifest.js');
|
|
6
|
-
|
|
7
|
-
async function test() {
|
|
8
|
-
const exporter = new PlantUMLExporter();
|
|
9
|
-
const manifest = new Manifest({
|
|
10
|
-
name: "Test Model",
|
|
11
|
-
version: "1.0.0",
|
|
12
|
-
description: "Test architecture",
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
const model = new Model("/test", manifest);
|
|
16
|
-
const motivationLayer = new Layer("motivation");
|
|
17
|
-
const goal = new Element({
|
|
18
|
-
id: "motivation-goal-increase-revenue",
|
|
19
|
-
type: "goal",
|
|
20
|
-
name: "Increase Revenue",
|
|
21
|
-
});
|
|
22
|
-
motivationLayer.addElement(goal);
|
|
23
|
-
model.addLayer(motivationLayer);
|
|
24
|
-
|
|
25
|
-
const output = await exporter.export(model, {});
|
|
26
|
-
console.log("=== OUTPUT ===");
|
|
27
|
-
console.log(output);
|
|
28
|
-
console.log("=== END ===");
|
|
29
|
-
console.log("Ends with @enduml\\n:", output.endsWith("@enduml\n"));
|
|
30
|
-
console.log("Includes component Increase Revenue:", output.includes('component "Increase Revenue"'));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
test().catch(console.error);
|
package/test-special.mjs
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Model } from "./dist/core/model.js";
|
|
2
|
-
import { Layer } from "./dist/core/layer.js";
|
|
3
|
-
import { Element } from "./dist/core/element.js";
|
|
4
|
-
import { Manifest } from "./dist/core/manifest.js";
|
|
5
|
-
import { ArchiMateExporter } from "./dist/export/archimate-exporter.js";
|
|
6
|
-
|
|
7
|
-
const ts = new Date().getTime();
|
|
8
|
-
const testDir = `/tmp/test-special-chars-${ts}`;
|
|
9
|
-
|
|
10
|
-
const manifest = new Manifest({
|
|
11
|
-
name: "Test Model",
|
|
12
|
-
version: "1.0.0",
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
const model = new Model(testDir, manifest);
|
|
16
|
-
const specialLayer = new Layer("security");
|
|
17
|
-
const element = new Element({
|
|
18
|
-
id: "security-threat-injection",
|
|
19
|
-
type: "threat",
|
|
20
|
-
name: "SQL Injection <attack> & XSS",
|
|
21
|
-
description: "Threat with special chars: <, >, &, \"",
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
console.log("Before adding element:");
|
|
25
|
-
console.log("Elements in layer:", specialLayer.listElements().length);
|
|
26
|
-
|
|
27
|
-
specialLayer.addElement(element);
|
|
28
|
-
|
|
29
|
-
console.log("After adding element:");
|
|
30
|
-
console.log("Elements in layer:", specialLayer.listElements().length);
|
|
31
|
-
|
|
32
|
-
model.addLayer(specialLayer);
|
|
33
|
-
|
|
34
|
-
console.log("After adding to model:");
|
|
35
|
-
const layer = await model.getLayer("security");
|
|
36
|
-
console.log("Layer from model:", layer?.name);
|
|
37
|
-
console.log("Elements in layer from model:", layer?.listElements().length);
|
|
38
|
-
|
|
39
|
-
const exporter = new ArchiMateExporter();
|
|
40
|
-
console.log("Exporter supported layers:", exporter.supportedLayers);
|
|
41
|
-
console.log("Security in supported:", exporter.supportedLayers.includes("security"));
|
|
42
|
-
|
|
43
|
-
const result = await exporter.export(model, {});
|
|
44
|
-
|
|
45
|
-
console.log("=== EXPORTED CONTENT ===");
|
|
46
|
-
console.log(result);
|
package/test_runner.ts
DELETED