@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
|
@@ -0,0 +1,670 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: LAYER_04_APP
|
|
3
|
+
description: Expert knowledge for Application Layer modeling in Documentation Robotics
|
|
4
|
+
triggers:
|
|
5
|
+
[
|
|
6
|
+
"application service",
|
|
7
|
+
"application component",
|
|
8
|
+
"data object",
|
|
9
|
+
"application function",
|
|
10
|
+
"application process",
|
|
11
|
+
"microservice",
|
|
12
|
+
"archimate application"
|
|
13
|
+
]
|
|
14
|
+
version: 0.8.1
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Application Layer Skill
|
|
18
|
+
|
|
19
|
+
**Layer Number:** 04
|
|
20
|
+
**Specification:** Metadata Model Spec v0.8.1
|
|
21
|
+
**Purpose:** Describes application services, components, and interfaces that support business processes and bridge requirements with technical implementation.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Layer Overview
|
|
26
|
+
|
|
27
|
+
The Application Layer captures **application architecture**:
|
|
28
|
+
|
|
29
|
+
- **WHAT** - Application services exposed to business
|
|
30
|
+
- **HOW** - Application components and functions
|
|
31
|
+
- **INTEGRATION** - Application interfaces and interactions
|
|
32
|
+
- **DATA** - Data objects processed by applications
|
|
33
|
+
- **EVENTS** - Application events for event-driven architecture
|
|
34
|
+
|
|
35
|
+
This layer uses **ArchiMate 3.2 Application Layer** standard with optional properties for external specifications (OpenAPI, orchestration definitions, event schemas).
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Entity Types
|
|
40
|
+
|
|
41
|
+
> **CLI Introspection:** Run `dr schema types application` for the authoritative, always-current list of node types.
|
|
42
|
+
> Run `dr schema node <type-id>` for full attribute details on any type.
|
|
43
|
+
|
|
44
|
+
| Entity Type | Description | Key Attributes |
|
|
45
|
+
| ---------------------------- | ------------------------------------------------------ | -------------------------------------------------------------------------------- |
|
|
46
|
+
| **ApplicationComponent** | Modular, deployable, replaceable part of a system | Types: frontend, backend, mobile, desktop, service, library, batch, worker |
|
|
47
|
+
| **ApplicationCollaboration** | Aggregate of application components working together | Example: Microservices ecosystem, service mesh |
|
|
48
|
+
| **ApplicationInterface** | Point of access where application service is available | Protocols: REST, GraphQL, SOAP, gRPC, WebSocket, Message Queue, Event Bus |
|
|
49
|
+
| **ApplicationFunction** | Automated behavior performed by application component | Examples: Authentication, Data Validation, Caching, Logging |
|
|
50
|
+
| **ApplicationInteraction** | Unit of collective application behavior | Patterns: request-response, publish-subscribe, async-messaging, streaming, batch |
|
|
51
|
+
| **ApplicationProcess** | Sequence of application behaviors (orchestration/saga) | Can reference orchestration definitions (Temporal, Conductor, Camunda) |
|
|
52
|
+
| **ApplicationEvent** | Application state change notification | Types: domain-event, integration-event, system-event, audit-event |
|
|
53
|
+
| **ApplicationService** | Service that exposes application functionality | Types: synchronous, asynchronous, batch, streaming, webhook |
|
|
54
|
+
| **DataObject** | Data structured for automated processing | Includes schema reference, PII marking, retention policies |
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Intra-Layer Relationships
|
|
59
|
+
|
|
60
|
+
### Structural Relationships
|
|
61
|
+
|
|
62
|
+
| Source Type | Predicate | Target Type | Example |
|
|
63
|
+
| ------------------------ | ----------- | ---------------------- | ---------------------------------------------------------------------------------------- |
|
|
64
|
+
| ApplicationCollaboration | aggregates | ApplicationComponent | "Payment Ecosystem" aggregates "PaymentService", "FraudDetection", "NotificationService" |
|
|
65
|
+
| ApplicationComponent | composes | ApplicationInterface | Component exposes interface for external access |
|
|
66
|
+
| ApplicationProcess | composes | ApplicationProcess | Workflow composed of sub-processes (saga pattern) |
|
|
67
|
+
| ApplicationComponent | assigned-to | ApplicationFunction | Component performs specific function |
|
|
68
|
+
| ApplicationCollaboration | assigned-to | ApplicationInteraction | Collaboration executes interaction pattern |
|
|
69
|
+
| ApplicationComponent | realizes | ApplicationService | "UserManagementAPI" realizes "User Management Service" |
|
|
70
|
+
| ApplicationFunction | realizes | ApplicationService | "Authentication Function" realizes "Auth Service" |
|
|
71
|
+
| ApplicationProcess | realizes | ApplicationService | "Order Processing Workflow" realizes "Order Service" |
|
|
72
|
+
| ApplicationService | realizes | ApplicationInterface | Service exposes interface |
|
|
73
|
+
| DataObject | specializes | DataObject | "CustomerOrder" specializes "Order" |
|
|
74
|
+
|
|
75
|
+
### Behavioral Relationships
|
|
76
|
+
|
|
77
|
+
| Source Type | Predicate | Target Type | Example |
|
|
78
|
+
| ---------------------- | --------- | -------------------- | ----------------------------------------------- |
|
|
79
|
+
| ApplicationEvent | triggers | ApplicationComponent | "OrderCreated" triggers "InventoryService" |
|
|
80
|
+
| ApplicationEvent | triggers | ApplicationFunction | "UserLoggedIn" triggers "AuditLogging" function |
|
|
81
|
+
| ApplicationEvent | triggers | ApplicationProcess | "PaymentFailed" triggers "RefundProcess" |
|
|
82
|
+
| ApplicationProcess | triggers | ApplicationEvent | Workflow completion triggers event |
|
|
83
|
+
| ApplicationService | flows-to | ApplicationService | Synchronous service-to-service call |
|
|
84
|
+
| ApplicationProcess | flows-to | ApplicationProcess | Sequential process orchestration |
|
|
85
|
+
| ApplicationService | accesses | DataObject | Service reads/writes data |
|
|
86
|
+
| ApplicationFunction | accesses | DataObject | Function operates on data |
|
|
87
|
+
| ApplicationProcess | accesses | DataObject | Workflow manipulates data |
|
|
88
|
+
| ApplicationInteraction | accesses | DataObject | Interaction pattern involves data exchange |
|
|
89
|
+
| ApplicationInterface | serves | ApplicationComponent | Interface provides access to component |
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Cross-Layer References
|
|
94
|
+
|
|
95
|
+
### Outgoing References (Application → Other Layers)
|
|
96
|
+
|
|
97
|
+
| Target Layer | Reference Type | Example |
|
|
98
|
+
| ------------------------ | ------------------------------------------------------- | ------------------------------------------ |
|
|
99
|
+
| **Layer 1 (Motivation)** | ApplicationService supports **Goal** | Service achieves business goals |
|
|
100
|
+
| **Layer 1 (Motivation)** | ApplicationService delivers **Value** | Service delivers business value |
|
|
101
|
+
| **Layer 1 (Motivation)** | ApplicationService governed by **Principle** | Service follows architectural principles |
|
|
102
|
+
| **Layer 1 (Motivation)** | ApplicationFunction fulfills **Requirement** | Function implements functional requirement |
|
|
103
|
+
| **Layer 2 (Business)** | ApplicationService realizes **BusinessService** | Tech realizes business capability |
|
|
104
|
+
| **Layer 2 (Business)** | ApplicationProcess supports **BusinessProcess** | Automates business workflow |
|
|
105
|
+
| **Layer 2 (Business)** | DataObject represents **BusinessObject** | Technical data represents business concept |
|
|
106
|
+
| **Layer 5 (Technology)** | ApplicationComponent deployed-on **Node** | Service deployed to Kubernetes cluster |
|
|
107
|
+
| **Layer 5 (Technology)** | ApplicationService uses **TechnologyService** | Application uses database service |
|
|
108
|
+
| **Layer 5 (Technology)** | DataObject stored-in **Artifact** | Data persisted in database |
|
|
109
|
+
| **Layer 6 (API)** | ApplicationService defined-by **OpenAPI Specification** | Service has OpenAPI contract |
|
|
110
|
+
| **Layer 7 (Data Model)** | DataObject defined-by **JSON Schema** | Data structure defined as schema |
|
|
111
|
+
| **Layer 11 (APM)** | ApplicationService tracked-by **BusinessMetric** | Service performance monitored |
|
|
112
|
+
| **Layer 11 (APM)** | ApplicationService has-sla **SLA Target** | Latency, availability targets |
|
|
113
|
+
| **Layer 11 (APM)** | ApplicationService traced-by **APM** | Distributed tracing enabled |
|
|
114
|
+
|
|
115
|
+
### Incoming References (Lower Layers → Application)
|
|
116
|
+
|
|
117
|
+
Lower layers reference Application layer to show:
|
|
118
|
+
|
|
119
|
+
- **Technology supports Application** - Infrastructure hosts application components
|
|
120
|
+
- **APIs implement Application Services** - OpenAPI specs define service contracts
|
|
121
|
+
- **Data schemas define DataObjects** - JSON schemas provide data structure
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Codebase Detection Patterns
|
|
126
|
+
|
|
127
|
+
### Pattern 1: Microservice Component
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
# FastAPI microservice
|
|
131
|
+
from fastapi import FastAPI
|
|
132
|
+
|
|
133
|
+
app = FastAPI(
|
|
134
|
+
title="User Management Service",
|
|
135
|
+
description="Handles user authentication and profile management",
|
|
136
|
+
version="1.0.0"
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
@app.get("/health")
|
|
140
|
+
async def health_check():
|
|
141
|
+
return {"status": "healthy"}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Maps to:**
|
|
145
|
+
|
|
146
|
+
- ApplicationComponent: "UserManagementService" (type: backend, subtype: microservice)
|
|
147
|
+
- ApplicationService: "User Management Service" (type: synchronous)
|
|
148
|
+
- ApplicationInterface: "REST API" (protocol: REST)
|
|
149
|
+
|
|
150
|
+
### Pattern 2: Application Function (Utility)
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
// Authentication utility function
|
|
154
|
+
export class AuthenticationService {
|
|
155
|
+
/**
|
|
156
|
+
* Validates JWT token and returns user context
|
|
157
|
+
* ApplicationFunction: Token Validation
|
|
158
|
+
*/
|
|
159
|
+
async validateToken(token: string): Promise<UserContext> {
|
|
160
|
+
// Implementation
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**Maps to:**
|
|
166
|
+
|
|
167
|
+
- ApplicationFunction: "Token Validation"
|
|
168
|
+
- ApplicationComponent: "AuthenticationService"
|
|
169
|
+
|
|
170
|
+
### Pattern 3: Event-Driven Architecture
|
|
171
|
+
|
|
172
|
+
```python
|
|
173
|
+
# Event definitions
|
|
174
|
+
from dataclasses import dataclass
|
|
175
|
+
from enum import Enum
|
|
176
|
+
|
|
177
|
+
class ApplicationEventType(Enum):
|
|
178
|
+
ORDER_CREATED = "order.created"
|
|
179
|
+
ORDER_FULFILLED = "order.fulfilled"
|
|
180
|
+
PAYMENT_PROCESSED = "payment.processed"
|
|
181
|
+
|
|
182
|
+
@dataclass
|
|
183
|
+
class OrderCreatedEvent:
|
|
184
|
+
"""
|
|
185
|
+
Domain event: Order created
|
|
186
|
+
Schema: schemas/events/order-created.json
|
|
187
|
+
Topic: orders.created
|
|
188
|
+
"""
|
|
189
|
+
order_id: str
|
|
190
|
+
customer_id: str
|
|
191
|
+
timestamp: datetime
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Maps to:**
|
|
195
|
+
|
|
196
|
+
- ApplicationEvent: "OrderCreated" (type: domain-event, topic: orders.created)
|
|
197
|
+
- Properties: schema-ref, event-version
|
|
198
|
+
- Triggers other ApplicationComponents
|
|
199
|
+
|
|
200
|
+
### Pattern 4: Service Orchestration (Saga)
|
|
201
|
+
|
|
202
|
+
```python
|
|
203
|
+
# Temporal workflow (saga pattern)
|
|
204
|
+
from temporalio import workflow
|
|
205
|
+
|
|
206
|
+
@workflow.defn
|
|
207
|
+
class OrderFulfillmentWorkflow:
|
|
208
|
+
"""
|
|
209
|
+
Order fulfillment orchestration
|
|
210
|
+
ApplicationProcess: Order Fulfillment Saga
|
|
211
|
+
Pattern: Saga with compensation
|
|
212
|
+
"""
|
|
213
|
+
@workflow.run
|
|
214
|
+
async def run(self, order_id: str) -> str:
|
|
215
|
+
# Step 1: Reserve inventory
|
|
216
|
+
await workflow.execute_activity(reserve_inventory, order_id)
|
|
217
|
+
|
|
218
|
+
# Step 2: Process payment
|
|
219
|
+
await workflow.execute_activity(process_payment, order_id)
|
|
220
|
+
|
|
221
|
+
# Step 3: Ship order
|
|
222
|
+
await workflow.execute_activity(ship_order, order_id)
|
|
223
|
+
|
|
224
|
+
return "fulfilled"
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
**Maps to:**
|
|
228
|
+
|
|
229
|
+
- ApplicationProcess: "OrderFulfillmentSaga" (pattern: saga)
|
|
230
|
+
- Properties: orchestration-engine=temporal, compensation-enabled=true
|
|
231
|
+
- Composes sub-processes (reserve, pay, ship)
|
|
232
|
+
|
|
233
|
+
### Pattern 5: Data Transfer Object (DTO)
|
|
234
|
+
|
|
235
|
+
```typescript
|
|
236
|
+
// Data object definitions
|
|
237
|
+
export interface UserDTO {
|
|
238
|
+
/**
|
|
239
|
+
* User data object
|
|
240
|
+
* Schema: schemas/user.schema.json
|
|
241
|
+
* PII: true (contains email, name)
|
|
242
|
+
* Retention: 7 years
|
|
243
|
+
*/
|
|
244
|
+
userId: string;
|
|
245
|
+
email: string;
|
|
246
|
+
name: string;
|
|
247
|
+
createdAt: Date;
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**Maps to:**
|
|
252
|
+
|
|
253
|
+
- DataObject: "User"
|
|
254
|
+
- Properties: schema-ref=user.schema.json, pii=true, retention-period=7y
|
|
255
|
+
|
|
256
|
+
### Pattern 6: gRPC Service Interface
|
|
257
|
+
|
|
258
|
+
```protobuf
|
|
259
|
+
// gRPC service definition
|
|
260
|
+
service UserService {
|
|
261
|
+
// ApplicationInterface: gRPC
|
|
262
|
+
// Protocol: gRPC
|
|
263
|
+
rpc GetUser (GetUserRequest) returns (User);
|
|
264
|
+
rpc CreateUser (CreateUserRequest) returns (User);
|
|
265
|
+
rpc UpdateUser (UpdateUserRequest) returns (User);
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
**Maps to:**
|
|
270
|
+
|
|
271
|
+
- ApplicationInterface: "UserServiceGRPC" (protocol: gRPC)
|
|
272
|
+
- ApplicationService: "User Service"
|
|
273
|
+
- ApplicationComponent: "UserService"
|
|
274
|
+
|
|
275
|
+
### Pattern 7: Message Queue Consumer
|
|
276
|
+
|
|
277
|
+
```python
|
|
278
|
+
# RabbitMQ consumer
|
|
279
|
+
from kombu import Connection, Queue
|
|
280
|
+
|
|
281
|
+
class OrderEventConsumer:
|
|
282
|
+
"""
|
|
283
|
+
Consumes order events from message queue
|
|
284
|
+
ApplicationComponent: OrderEventConsumer (type: worker)
|
|
285
|
+
ApplicationInterface: Message Queue (protocol: AMQP)
|
|
286
|
+
"""
|
|
287
|
+
def __init__(self):
|
|
288
|
+
self.queue = Queue('orders.created', exchange='orders')
|
|
289
|
+
|
|
290
|
+
def consume(self):
|
|
291
|
+
with Connection('amqp://localhost') as conn:
|
|
292
|
+
with conn.Consumer(self.queue, callbacks=[self.handle_order]):
|
|
293
|
+
conn.drain_events()
|
|
294
|
+
|
|
295
|
+
def handle_order(self, body, message):
|
|
296
|
+
# Process order event
|
|
297
|
+
message.ack()
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**Maps to:**
|
|
301
|
+
|
|
302
|
+
- ApplicationComponent: "OrderEventConsumer" (type: worker)
|
|
303
|
+
- ApplicationInterface: "OrderQueue" (protocol: AMQP)
|
|
304
|
+
- ApplicationEvent: "OrderCreated" (triggers this component)
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## Modeling Workflow
|
|
309
|
+
|
|
310
|
+
### Step 1: Identify Application Components
|
|
311
|
+
|
|
312
|
+
```bash
|
|
313
|
+
# Frontend component
|
|
314
|
+
dr add application component "web-app" \
|
|
315
|
+
--properties type=frontend,technology=react,repository=github.com/org/web-app \
|
|
316
|
+
--description "Customer-facing web application"
|
|
317
|
+
|
|
318
|
+
# Backend microservices
|
|
319
|
+
dr add application component "user-service" \
|
|
320
|
+
--properties type=backend,subtype=microservice,language=python \
|
|
321
|
+
--description "User management microservice"
|
|
322
|
+
|
|
323
|
+
dr add application component "order-service" \
|
|
324
|
+
--properties type=backend,subtype=microservice,language=typescript \
|
|
325
|
+
--description "Order processing microservice"
|
|
326
|
+
|
|
327
|
+
# Worker component
|
|
328
|
+
dr add application component "email-worker" \
|
|
329
|
+
--properties type=worker,runtime=nodejs \
|
|
330
|
+
--description "Background worker for email notifications"
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### Step 2: Define Application Services
|
|
334
|
+
|
|
335
|
+
```bash
|
|
336
|
+
# Synchronous service
|
|
337
|
+
dr add application service "user-management-api" \
|
|
338
|
+
--properties type=synchronous,protocol=REST,openapi-spec=specs/user-api.yaml \
|
|
339
|
+
--description "User management REST API"
|
|
340
|
+
|
|
341
|
+
# Asynchronous service
|
|
342
|
+
dr add application service "notification-service" \
|
|
343
|
+
--properties type=asynchronous,pattern=publish-subscribe \
|
|
344
|
+
--description "Asynchronous notification delivery"
|
|
345
|
+
|
|
346
|
+
# Link component to service
|
|
347
|
+
dr relationship add "application/component/user-service" \
|
|
348
|
+
realizes "application/service/user-management-api"
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
### Step 3: Model Application Interfaces
|
|
352
|
+
|
|
353
|
+
```bash
|
|
354
|
+
# REST API interface
|
|
355
|
+
dr add application interface "user-api-rest" \
|
|
356
|
+
--properties protocol=REST,base-url=/api/v1/users,authentication=JWT \
|
|
357
|
+
--description "REST interface for user service"
|
|
358
|
+
|
|
359
|
+
# gRPC interface
|
|
360
|
+
dr add application interface "order-grpc" \
|
|
361
|
+
--properties protocol=gRPC,port=50051 \
|
|
362
|
+
--description "gRPC interface for order service"
|
|
363
|
+
|
|
364
|
+
# Message queue interface
|
|
365
|
+
dr add application interface "event-bus" \
|
|
366
|
+
--properties protocol=AMQP,broker=rabbitmq \
|
|
367
|
+
--description "Event bus for async communication"
|
|
368
|
+
|
|
369
|
+
# Link service to interface
|
|
370
|
+
dr relationship add "application/service/user-management-api" \
|
|
371
|
+
realizes "application/interface/user-api-rest"
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
### Step 4: Define Application Functions
|
|
375
|
+
|
|
376
|
+
```bash
|
|
377
|
+
# Core functions
|
|
378
|
+
dr add application function "authentication" \
|
|
379
|
+
--properties type=security \
|
|
380
|
+
--description "Validates user credentials and issues tokens"
|
|
381
|
+
|
|
382
|
+
dr add application function "data-validation" \
|
|
383
|
+
--properties type=business-logic \
|
|
384
|
+
--description "Validates input data against business rules"
|
|
385
|
+
|
|
386
|
+
dr add application function "caching" \
|
|
387
|
+
--properties type=performance,strategy=redis \
|
|
388
|
+
--description "Caches frequently accessed data"
|
|
389
|
+
|
|
390
|
+
# Assign function to component
|
|
391
|
+
dr relationship add "application/component/user-service" \
|
|
392
|
+
assigned-to "application/function/authentication"
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
### Step 5: Model Application Events
|
|
396
|
+
|
|
397
|
+
```bash
|
|
398
|
+
# Domain events
|
|
399
|
+
dr add application event "order-created" \
|
|
400
|
+
--properties type=domain-event,topic=orders.created,schema=schemas/order-created.json \
|
|
401
|
+
--description "Published when new order is created"
|
|
402
|
+
|
|
403
|
+
dr add application event "payment-processed" \
|
|
404
|
+
--properties type=domain-event,topic=payments.processed,schema=schemas/payment-processed.json \
|
|
405
|
+
--description "Published when payment completes"
|
|
406
|
+
|
|
407
|
+
# Event triggering
|
|
408
|
+
dr relationship add "application/event/order-created" \
|
|
409
|
+
triggers "application/component/inventory-service"
|
|
410
|
+
|
|
411
|
+
dr relationship add "application/event/order-created" \
|
|
412
|
+
triggers "application/component/email-worker"
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
### Step 6: Define Data Objects
|
|
416
|
+
|
|
417
|
+
```bash
|
|
418
|
+
# Core data objects
|
|
419
|
+
dr add application data-object "user" \
|
|
420
|
+
--properties schema-ref=schemas/user.schema.json,pii=true,retention-period=7y \
|
|
421
|
+
--description "User account information"
|
|
422
|
+
|
|
423
|
+
dr add application data-object "order" \
|
|
424
|
+
--properties schema-ref=schemas/order.schema.json,pii=false,retention-period=10y \
|
|
425
|
+
--description "Customer order data"
|
|
426
|
+
|
|
427
|
+
# Service access to data
|
|
428
|
+
dr relationship add "application/service/user-management-api" \
|
|
429
|
+
accesses "application/data-object/user"
|
|
430
|
+
|
|
431
|
+
dr relationship add "application/service/order-api" \
|
|
432
|
+
accesses "application/data-object/order"
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
### Step 7: Model Application Processes (Orchestration)
|
|
436
|
+
|
|
437
|
+
```bash
|
|
438
|
+
# Saga workflow
|
|
439
|
+
dr add application process "order-fulfillment-saga" \
|
|
440
|
+
--properties pattern=saga,orchestration-engine=temporal,compensation=true \
|
|
441
|
+
--description "End-to-end order fulfillment orchestration"
|
|
442
|
+
|
|
443
|
+
# Sub-processes
|
|
444
|
+
dr add application process "reserve-inventory" \
|
|
445
|
+
--description "Reserve items from inventory"
|
|
446
|
+
|
|
447
|
+
dr add application process "process-payment" \
|
|
448
|
+
--description "Charge customer payment method"
|
|
449
|
+
|
|
450
|
+
dr add application process "ship-order" \
|
|
451
|
+
--description "Initiate shipping workflow"
|
|
452
|
+
|
|
453
|
+
# Process composition
|
|
454
|
+
dr relationship add "application/process/order-fulfillment-saga" \
|
|
455
|
+
composes "application/process/reserve-inventory"
|
|
456
|
+
|
|
457
|
+
dr relationship add "application/process/order-fulfillment-saga" \
|
|
458
|
+
composes "application/process/process-payment"
|
|
459
|
+
|
|
460
|
+
dr relationship add "application/process/order-fulfillment-saga" \
|
|
461
|
+
composes "application/process/ship-order"
|
|
462
|
+
|
|
463
|
+
# Process flows
|
|
464
|
+
dr relationship add "application/process/reserve-inventory" \
|
|
465
|
+
flows-to "application/process/process-payment"
|
|
466
|
+
|
|
467
|
+
dr relationship add "application/process/process-payment" \
|
|
468
|
+
flows-to "application/process/ship-order"
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
### Step 8: Cross-Layer Integration
|
|
472
|
+
|
|
473
|
+
```bash
|
|
474
|
+
# Link to business layer
|
|
475
|
+
dr relationship add "application/service/order-api" \
|
|
476
|
+
realizes "business/service/order-management"
|
|
477
|
+
|
|
478
|
+
# Link to motivation layer
|
|
479
|
+
dr relationship add "application/service/user-management-api" \
|
|
480
|
+
supports "motivation/goal/improve-user-experience"
|
|
481
|
+
|
|
482
|
+
# Link to technology layer
|
|
483
|
+
dr relationship add "application/component/user-service" \
|
|
484
|
+
deployed-on "technology/node/k8s-cluster-prod"
|
|
485
|
+
|
|
486
|
+
# Link to API layer
|
|
487
|
+
dr relationship add "application/service/user-management-api" \
|
|
488
|
+
defined-by "api/openapi-document/user-api"
|
|
489
|
+
|
|
490
|
+
# Link to data model layer
|
|
491
|
+
dr relationship add "application/data-object/user" \
|
|
492
|
+
defined-by "data-model/schema/user"
|
|
493
|
+
|
|
494
|
+
# Link to APM layer
|
|
495
|
+
dr relationship add "application/service/order-api" \
|
|
496
|
+
tracked-by "apm/metric/order-processing-latency"
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
### Step 9: Validate
|
|
500
|
+
|
|
501
|
+
```bash
|
|
502
|
+
dr validate --layer application
|
|
503
|
+
dr validate --validate-relationships
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
---
|
|
507
|
+
|
|
508
|
+
## Application Architecture Patterns
|
|
509
|
+
|
|
510
|
+
### Pattern 1: Microservices Architecture
|
|
511
|
+
|
|
512
|
+
```
|
|
513
|
+
ApplicationCollaboration: "E-commerce Platform"
|
|
514
|
+
├── aggregates → ApplicationComponent: "UserService"
|
|
515
|
+
│ ├── realizes → ApplicationService: "User API"
|
|
516
|
+
│ └── deployed-on → Node: "K8s Cluster"
|
|
517
|
+
├── aggregates → ApplicationComponent: "OrderService"
|
|
518
|
+
│ ├── realizes → ApplicationService: "Order API"
|
|
519
|
+
│ └── deployed-on → Node: "K8s Cluster"
|
|
520
|
+
├── aggregates → ApplicationComponent: "PaymentService"
|
|
521
|
+
│ └── realizes → ApplicationService: "Payment API"
|
|
522
|
+
└── uses → ApplicationInterface: "API Gateway"
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
### Pattern 2: Event-Driven Architecture
|
|
526
|
+
|
|
527
|
+
```
|
|
528
|
+
ApplicationEvent: "OrderCreated"
|
|
529
|
+
├── triggers → ApplicationComponent: "InventoryService"
|
|
530
|
+
├── triggers → ApplicationComponent: "EmailWorker"
|
|
531
|
+
├── triggers → ApplicationComponent: "AnalyticsService"
|
|
532
|
+
└── published-by → ApplicationComponent: "OrderService"
|
|
533
|
+
└── uses → ApplicationInterface: "EventBus" (protocol: AMQP)
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
### Pattern 3: Saga Orchestration
|
|
537
|
+
|
|
538
|
+
```
|
|
539
|
+
ApplicationProcess: "Order Fulfillment Saga"
|
|
540
|
+
├── composes → ApplicationProcess: "Reserve Inventory"
|
|
541
|
+
│ ├── flows-to → ApplicationProcess: "Process Payment"
|
|
542
|
+
│ └── compensation → ApplicationProcess: "Release Inventory"
|
|
543
|
+
├── composes → ApplicationProcess: "Process Payment"
|
|
544
|
+
│ ├── flows-to → ApplicationProcess: "Ship Order"
|
|
545
|
+
│ └── compensation → ApplicationProcess: "Refund Payment"
|
|
546
|
+
└── properties: orchestration-engine=temporal, pattern=saga
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
### Pattern 4: API Gateway Pattern
|
|
550
|
+
|
|
551
|
+
```
|
|
552
|
+
ApplicationInterface: "API Gateway"
|
|
553
|
+
├── protocol: REST
|
|
554
|
+
├── routes-to → ApplicationService: "User API"
|
|
555
|
+
├── routes-to → ApplicationService: "Order API"
|
|
556
|
+
├── routes-to → ApplicationService: "Payment API"
|
|
557
|
+
├── applies → ApplicationFunction: "Authentication"
|
|
558
|
+
├── applies → ApplicationFunction: "Rate Limiting"
|
|
559
|
+
└── applies → ApplicationFunction: "Request Logging"
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
---
|
|
563
|
+
|
|
564
|
+
## Best Practices
|
|
565
|
+
|
|
566
|
+
1. **Components are Deployable Units** - One component = one deployment artifact
|
|
567
|
+
2. **Services are Contracts** - ApplicationService represents capability, not implementation
|
|
568
|
+
3. **Separate Read from Write** - Consider CQRS pattern for complex domains
|
|
569
|
+
4. **Model Events Explicitly** - Event-driven systems need first-class event entities
|
|
570
|
+
5. **Link to Business Layer** - Every application service should realize a business service
|
|
571
|
+
6. **Reference External Specs** - Link to OpenAPI, GraphQL schemas, Protobuf definitions
|
|
572
|
+
7. **Mark PII Explicitly** - DataObjects with PII need retention and security policies
|
|
573
|
+
8. **Use Orchestration for Sagas** - Model complex workflows as ApplicationProcess
|
|
574
|
+
9. **Distinguish Interface from Service** - Interface is access point; Service is capability
|
|
575
|
+
10. **Track Dependencies** - Model service-to-service dependencies clearly
|
|
576
|
+
|
|
577
|
+
---
|
|
578
|
+
|
|
579
|
+
## Framework-Specific Patterns
|
|
580
|
+
|
|
581
|
+
### FastAPI / Flask (Python)
|
|
582
|
+
|
|
583
|
+
```python
|
|
584
|
+
# FastAPI application
|
|
585
|
+
from fastapi import FastAPI
|
|
586
|
+
|
|
587
|
+
app = FastAPI(title="User Service") # ApplicationComponent + ApplicationService
|
|
588
|
+
|
|
589
|
+
@app.get("/users/{user_id}") # ApplicationInterface (REST)
|
|
590
|
+
async def get_user(user_id: str) -> UserDTO: # DataObject
|
|
591
|
+
pass # ApplicationFunction: "GetUser"
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
### NestJS / Express (TypeScript/Node.js)
|
|
595
|
+
|
|
596
|
+
```typescript
|
|
597
|
+
@Controller("orders") // ApplicationComponent
|
|
598
|
+
export class OrdersController {
|
|
599
|
+
@Get(":id") // ApplicationInterface (REST)
|
|
600
|
+
async getOrder(@Param("id") id: string): Promise<OrderDTO> {
|
|
601
|
+
// DataObject
|
|
602
|
+
// ApplicationFunction: "GetOrder"
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
### Spring Boot (Java)
|
|
608
|
+
|
|
609
|
+
```java
|
|
610
|
+
@RestController // ApplicationComponent
|
|
611
|
+
@RequestMapping("/api/products")
|
|
612
|
+
public class ProductController {
|
|
613
|
+
|
|
614
|
+
@GetMapping("/{id}") // ApplicationInterface (REST)
|
|
615
|
+
public ProductDTO getProduct(@PathVariable String id) { // DataObject
|
|
616
|
+
// ApplicationFunction: "GetProduct"
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
---
|
|
622
|
+
|
|
623
|
+
## Validation Tips
|
|
624
|
+
|
|
625
|
+
| Issue | Cause | Fix |
|
|
626
|
+
| ---------------------------- | --------------------------------------------- | ----------------------------------------------------------- |
|
|
627
|
+
| Orphaned Component | Component not assigned to function or service | Assign to ApplicationFunction or realize ApplicationService |
|
|
628
|
+
| Unrealized Service | Service not realized by component/function | Add realization link |
|
|
629
|
+
| Missing Interface | Service has no interface | Add ApplicationInterface |
|
|
630
|
+
| No Cross-Layer Relationships | Application not linked to business/technology | Add realization and deployment relationships |
|
|
631
|
+
| Undocumented Events | Events exist in code but not modeled | Add ApplicationEvent entities |
|
|
632
|
+
| Missing Data Objects | Services access data not modeled | Add DataObject entities |
|
|
633
|
+
| No Orchestration | Complex workflows not modeled as processes | Add ApplicationProcess for sagas |
|
|
634
|
+
|
|
635
|
+
---
|
|
636
|
+
|
|
637
|
+
## Quick Reference
|
|
638
|
+
|
|
639
|
+
**Add Commands:**
|
|
640
|
+
|
|
641
|
+
```bash
|
|
642
|
+
dr add application component <name> --properties type=<type>
|
|
643
|
+
dr add application service <name> --properties type=<type>,protocol=<protocol>
|
|
644
|
+
dr add application interface <name> --properties protocol=<protocol>
|
|
645
|
+
dr add application function <name> --properties type=<type>
|
|
646
|
+
dr add application event <name> --properties type=<type>,topic=<topic>
|
|
647
|
+
dr add application data-object <name> --properties schema-ref=<path>,pii=<bool>
|
|
648
|
+
dr add application process <name> --properties pattern=<pattern>
|
|
649
|
+
```
|
|
650
|
+
|
|
651
|
+
**Relationship Commands:**
|
|
652
|
+
|
|
653
|
+
```bash
|
|
654
|
+
dr relationship add <component> realizes <service>
|
|
655
|
+
dr relationship add <service> realizes <interface>
|
|
656
|
+
dr relationship add <component> assigned-to <function>
|
|
657
|
+
dr relationship add <event> triggers <component>
|
|
658
|
+
dr relationship add <service> accesses <data-object>
|
|
659
|
+
dr relationship add <process> composes <sub-process>
|
|
660
|
+
dr relationship add <process-a> flows-to <process-b>
|
|
661
|
+
```
|
|
662
|
+
|
|
663
|
+
**Cross-Layer Commands:**
|
|
664
|
+
|
|
665
|
+
```bash
|
|
666
|
+
dr relationship add application/<service> realizes business/<service>
|
|
667
|
+
dr relationship add application/<component> deployed-on technology/<node>
|
|
668
|
+
dr relationship add application/<service> defined-by api/<openapi-doc>
|
|
669
|
+
dr relationship add application/<data-object> defined-by data-model/<schema>
|
|
670
|
+
```
|