@documentation-robotics/cli 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -16
- package/dist/analysis/relationship-classifier.js +2 -9
- package/dist/analysis/relationship-classifier.js.map +2 -2
- package/dist/analyzers/active-analyzer.js +62 -0
- package/dist/analyzers/active-analyzer.js.map +7 -0
- package/dist/analyzers/call-graph-utils.js +2 -2
- package/dist/analyzers/call-graph-utils.js.map +2 -2
- package/dist/analyzers/cards/build.js +191 -0
- package/dist/analyzers/cards/build.js.map +7 -0
- package/dist/analyzers/cards/classify.js +42 -0
- package/dist/analyzers/cards/classify.js.map +7 -0
- package/dist/analyzers/cards/edge-index.js +44 -0
- package/dist/analyzers/cards/edge-index.js.map +7 -0
- package/dist/analyzers/cards/extract.js +138 -0
- package/dist/analyzers/cards/extract.js.map +7 -0
- package/dist/analyzers/cards/facts.js +46 -0
- package/dist/analyzers/cards/facts.js.map +7 -0
- package/dist/analyzers/cards/graph.js +42 -0
- package/dist/analyzers/cards/graph.js.map +7 -0
- package/dist/analyzers/cards/index.js +8 -0
- package/dist/analyzers/cards/index.js.map +7 -0
- package/dist/analyzers/cards/routes.js +96 -0
- package/dist/analyzers/cards/routes.js.map +7 -0
- package/dist/analyzers/cards/tier0.js +18 -0
- package/dist/analyzers/cards/tier0.js.map +7 -0
- package/dist/analyzers/cards/types.js +1 -0
- package/dist/analyzers/cards/types.js.map +7 -0
- package/dist/analyzers/cbm-analyzer.js +270 -174
- package/dist/analyzers/cbm-analyzer.js.map +2 -2
- package/dist/analyzers/cbm-responses.js +342 -0
- package/dist/analyzers/cbm-responses.js.map +7 -0
- package/dist/analyzers/code-changes.js +159 -0
- package/dist/analyzers/code-changes.js.map +7 -0
- package/dist/analyzers/edge-relationships.js +49 -0
- package/dist/analyzers/edge-relationships.js.map +7 -0
- package/dist/analyzers/extraction-plan.js +541 -0
- package/dist/analyzers/extraction-plan.js.map +7 -0
- package/dist/analyzers/index-job.js +229 -0
- package/dist/analyzers/index-job.js.map +7 -0
- package/dist/analyzers/mapping-loader.js +9 -0
- package/dist/analyzers/mapping-loader.js.map +2 -2
- package/dist/analyzers/tier0-rules.js +153 -0
- package/dist/analyzers/tier0-rules.js.map +7 -0
- package/dist/analyzers/types.js.map +1 -1
- package/dist/audit/relationships/ai/prompts.js +10 -10
- package/dist/audit/relationships/ai/prompts.js.map +2 -2
- package/dist/audit/relationships/analysis/layer-templates.js +52 -52
- package/dist/audit/relationships/analysis/layer-templates.js.map +1 -1
- package/dist/cli.js +23 -11
- package/dist/cli.js.map +2 -2
- package/dist/coding-agents/default-permissions.js +31 -1
- package/dist/coding-agents/default-permissions.js.map +2 -2
- package/dist/coding-agents/drbot-mcp.js +269 -0
- package/dist/coding-agents/drbot-mcp.js.map +7 -0
- package/dist/commands/add.js +7 -4
- package/dist/commands/add.js.map +2 -2
- package/dist/commands/analyzer.js +143 -40
- package/dist/commands/analyzer.js.map +2 -2
- package/dist/commands/changeset-verify.js +63 -0
- package/dist/commands/changeset-verify.js.map +7 -0
- package/dist/commands/changeset.js +80 -29
- package/dist/commands/changeset.js.map +2 -2
- package/dist/commands/delete.js +10 -4
- package/dist/commands/delete.js.map +2 -2
- package/dist/commands/farm.js +176 -60
- package/dist/commands/farm.js.map +2 -2
- package/dist/commands/init.js +9 -26
- package/dist/commands/init.js.map +2 -2
- package/dist/commands/mcp.js +40 -21
- package/dist/commands/mcp.js.map +3 -3
- package/dist/commands/relationship.js +208 -37
- package/dist/commands/relationship.js.map +2 -2
- package/dist/commands/reports.js +3 -3
- package/dist/commands/reports.js.map +2 -2
- package/dist/commands/update.js +52 -32
- package/dist/commands/update.js.map +2 -2
- package/dist/commands/upgrade.js +99 -103
- package/dist/commands/upgrade.js.map +3 -3
- package/dist/commands/validate.js +19 -3
- package/dist/commands/validate.js.map +2 -2
- package/dist/commands/version.js +1 -1
- package/dist/commands/visualize.js +34 -15
- package/dist/commands/visualize.js.map +2 -2
- package/dist/core/annotation-store.js +15 -5
- package/dist/core/annotation-store.js.map +2 -2
- package/dist/core/catalog-migration.js +34 -0
- package/dist/core/catalog-migration.js.map +7 -0
- package/dist/core/changeset-analysis.js +421 -0
- package/dist/core/changeset-analysis.js.map +7 -0
- package/dist/core/changeset-base-index.js +160 -0
- package/dist/core/changeset-base-index.js.map +7 -0
- package/dist/core/changeset-brief-compact.js +256 -0
- package/dist/core/changeset-brief-compact.js.map +7 -0
- package/dist/core/changeset-brief-delta.js +102 -0
- package/dist/core/changeset-brief-delta.js.map +7 -0
- package/dist/core/changeset-graph.js +281 -0
- package/dist/core/changeset-graph.js.map +7 -0
- package/dist/core/changeset-only-guard.js +32 -0
- package/dist/core/changeset-only-guard.js.map +7 -0
- package/dist/core/changeset-summary.js +68 -0
- package/dist/core/changeset-summary.js.map +7 -0
- package/dist/core/changeset-validator.js +66 -20
- package/dist/core/changeset-validator.js.map +2 -2
- package/dist/core/changeset-verify.js +848 -0
- package/dist/core/changeset-verify.js.map +7 -0
- package/dist/core/changeset.js +56 -9
- package/dist/core/changeset.js.map +2 -2
- package/dist/core/element-type-migration.js +145 -0
- package/dist/core/element-type-migration.js.map +7 -0
- package/dist/core/extraction-observability.js +161 -0
- package/dist/core/extraction-observability.js.map +7 -0
- package/dist/core/farm-manifest.js +12 -6
- package/dist/core/farm-manifest.js.map +2 -2
- package/dist/core/farm-sync-engine.js +1 -1
- package/dist/core/farm-sync-engine.js.map +2 -2
- package/dist/core/farm-sync-state.js +10 -2
- package/dist/core/farm-sync-state.js.map +2 -2
- package/dist/core/migration-registry.js +88 -47
- package/dist/core/migration-registry.js.map +2 -2
- package/dist/core/model-upgrade.js +102 -0
- package/dist/core/model-upgrade.js.map +7 -0
- package/dist/core/model.js +82 -30
- package/dist/core/model.js.map +2 -2
- package/dist/core/mutation-handler.js +71 -6
- package/dist/core/mutation-handler.js.map +2 -2
- package/dist/core/project-init.js +53 -0
- package/dist/core/project-init.js.map +7 -0
- package/dist/core/relationship-migration-table.js +6639 -0
- package/dist/core/relationship-migration-table.js.map +7 -0
- package/dist/core/relationship-migration.js +272 -0
- package/dist/core/relationship-migration.js.map +7 -0
- package/dist/core/relationship-prune.js +49 -0
- package/dist/core/relationship-prune.js.map +7 -0
- package/dist/core/relationship-staging.js +161 -0
- package/dist/core/relationship-staging.js.map +7 -0
- package/dist/core/relationships.js +26 -4
- package/dist/core/relationships.js.map +2 -2
- package/dist/core/report-data-model.js +7 -13
- package/dist/core/report-data-model.js.map +2 -2
- package/dist/core/staged-changeset-storage.js +145 -18
- package/dist/core/staged-changeset-storage.js.map +2 -2
- package/dist/core/staged-source-reference.js +28 -0
- package/dist/core/staged-source-reference.js.map +7 -0
- package/dist/core/staging-area.js +166 -24
- package/dist/core/staging-area.js.map +2 -2
- package/dist/core/upgrade-plan.js +117 -0
- package/dist/core/upgrade-plan.js.map +7 -0
- package/dist/core/virtual-projection.js +13 -5
- package/dist/core/virtual-projection.js.map +2 -2
- package/dist/export/archimate-exporter.js +1 -0
- package/dist/export/archimate-exporter.js.map +2 -2
- package/dist/generated/compiled-validators.js +2 -2
- package/dist/generated/compiled-validators.js.map +2 -2
- package/dist/generated/layer-registry.js +16 -16
- package/dist/generated/layer-registry.js.map +2 -2
- package/dist/generated/node-types.js +186 -168
- package/dist/generated/node-types.js.map +2 -2
- package/dist/generated/relationship-index.js +2468 -7913
- package/dist/generated/relationship-index.js.map +2 -2
- package/dist/integrations/claude_code/.claude-plugin/plugin.json +24 -0
- package/dist/integrations/claude_code/agents/dr-architect.md +30 -3
- package/dist/integrations/claude_code/agents/dr-extractor.md +8 -2
- package/dist/integrations/claude_code/commands/dr-analyzer.md +565 -0
- package/dist/integrations/claude_code/commands/dr-changeset.md +2 -1
- package/dist/integrations/claude_code/commands/dr-map.md +20 -1
- package/dist/integrations/claude_code/commands/dr-plan.md +66 -0
- package/dist/integrations/claude_code/commands/dr-relate.md +106 -96
- package/dist/integrations/claude_code/commands/dr-verify.md +45 -2
- package/dist/integrations/claude_code/docs/END_TO_END_WALKTHROUGH.md +14 -0
- package/dist/integrations/claude_code/docs/MCP_SERVER.md +47 -26
- package/dist/integrations/claude_code/docs/QUICK_START.md +37 -8
- package/dist/integrations/claude_code/docs/README.md +68 -2
- package/dist/integrations/claude_code/plugin-agents/dr-advisor.md +255 -0
- package/dist/integrations/claude_code/plugin-agents/dr-architect.md +306 -0
- package/dist/integrations/claude_code/skills/dr_01_motivation_layer/SKILL.md +93 -72
- package/dist/integrations/claude_code/skills/dr_02_business_layer/SKILL.md +163 -126
- package/dist/integrations/claude_code/skills/dr_03_product_layer/SKILL.md +161 -126
- package/dist/integrations/claude_code/skills/dr_04_security_layer/SKILL.md +153 -133
- package/dist/integrations/claude_code/skills/dr_05_application_layer/SKILL.md +129 -100
- package/dist/integrations/claude_code/skills/dr_06_technology_layer/SKILL.md +111 -94
- package/dist/integrations/claude_code/skills/dr_07_api_layer/SKILL.md +143 -157
- package/dist/integrations/claude_code/skills/dr_08_data_model_layer/SKILL.md +117 -33
- package/dist/integrations/claude_code/skills/dr_09_dataset_layer/SKILL.md +74 -25
- package/dist/integrations/claude_code/skills/dr_10_ux_layer/SKILL.md +88 -12
- package/dist/integrations/claude_code/skills/dr_11_navigation_layer/SKILL.md +83 -24
- package/dist/integrations/claude_code/skills/dr_12_apm_layer/SKILL.md +57 -12
- package/dist/integrations/claude_code/skills/dr_13_testing_layer/SKILL.md +95 -15
- package/dist/integrations/claude_code/skills/dr_change_planning/SKILL.md +178 -0
- package/dist/integrations/claude_code/skills/dr_changeset_reviewer/SKILL.md +8 -0
- package/dist/integrations/claude_code/skills/dr_engineering_guide/SKILL.md +6 -1
- package/dist/integrations/github_copilot/agents/dr-architect.md +3 -1
- package/dist/integrations/github_copilot/skills/dr_01_motivation_layer/SKILL.md +182 -102
- package/dist/integrations/github_copilot/skills/dr_02_business_layer/SKILL.md +266 -148
- package/dist/integrations/github_copilot/skills/dr_03_product_layer/SKILL.md +547 -86
- package/dist/integrations/github_copilot/skills/dr_04_security_layer/SKILL.md +164 -169
- package/dist/integrations/github_copilot/skills/dr_05_application_layer/SKILL.md +420 -150
- package/dist/integrations/github_copilot/skills/dr_06_technology_layer/SKILL.md +331 -138
- package/dist/integrations/github_copilot/skills/dr_07_api_layer/SKILL.md +265 -201
- package/dist/integrations/github_copilot/skills/dr_08_data_model_layer/SKILL.md +181 -58
- package/dist/integrations/github_copilot/skills/dr_09_dataset_layer/SKILL.md +209 -57
- package/dist/integrations/github_copilot/skills/dr_10_ux_layer/SKILL.md +277 -112
- package/dist/integrations/github_copilot/skills/dr_11_navigation_layer/SKILL.md +219 -70
- package/dist/integrations/github_copilot/skills/dr_12_apm_layer/SKILL.md +189 -105
- package/dist/integrations/github_copilot/skills/dr_13_testing_layer/SKILL.md +225 -102
- package/dist/integrations/github_copilot/skills/dr_change_planning/SKILL.md +177 -0
- package/dist/integrations/github_copilot/skills/dr_changeset_reviewer/SKILL.md +3 -0
- package/dist/integrations/hash-utils.js.map +2 -2
- package/dist/mcp/api-key-manager.js +14 -1
- package/dist/mcp/api-key-manager.js.map +2 -2
- package/dist/mcp/changeset-only.js +45 -0
- package/dist/mcp/changeset-only.js.map +7 -0
- package/dist/mcp/project-root.js +85 -0
- package/dist/mcp/project-root.js.map +7 -0
- package/dist/mcp/server-instructions.js +27 -0
- package/dist/mcp/server-instructions.js.map +7 -0
- package/dist/mcp/strict-schema.js +52 -0
- package/dist/mcp/strict-schema.js.map +7 -0
- package/dist/mcp/tool-registry.js +55 -5
- package/dist/mcp/tool-registry.js.map +2 -2
- package/dist/mcp/tools/changeset-analysis-tools.js +98 -0
- package/dist/mcp/tools/changeset-analysis-tools.js.map +7 -0
- package/dist/mcp/tools/changeset-commit.js +224 -0
- package/dist/mcp/tools/changeset-commit.js.map +7 -0
- package/dist/mcp/tools/changeset-editing.js +260 -0
- package/dist/mcp/tools/changeset-editing.js.map +7 -0
- package/dist/mcp/tools/changeset-lifecycle.js +83 -0
- package/dist/mcp/tools/changeset-lifecycle.js.map +7 -0
- package/dist/mcp/tools/changeset-shared.js +31 -0
- package/dist/mcp/tools/changeset-shared.js.map +7 -0
- package/dist/mcp/tools/changeset-show.js +17 -1
- package/dist/mcp/tools/changeset-show.js.map +2 -2
- package/dist/mcp/tools/changeset-verify.js +49 -0
- package/dist/mcp/tools/changeset-verify.js.map +7 -0
- package/dist/mcp/tools/codebase-extract.js +836 -0
- package/dist/mcp/tools/codebase-extract.js.map +7 -0
- package/dist/mcp/tools/codebase-index.js +125 -0
- package/dist/mcp/tools/codebase-index.js.map +7 -0
- package/dist/mcp/tools/codebase-shared.js +265 -0
- package/dist/mcp/tools/codebase-shared.js.map +7 -0
- package/dist/mcp/tools/codebase-verify.js +48 -0
- package/dist/mcp/tools/codebase-verify.js.map +7 -0
- package/dist/mcp/tools/index.js +34 -1
- package/dist/mcp/tools/index.js.map +2 -2
- package/dist/mcp/tools/model-add.js +191 -74
- package/dist/mcp/tools/model-add.js.map +2 -2
- package/dist/mcp/tools/model-delete.js +2 -2
- package/dist/mcp/tools/model-delete.js.map +2 -2
- package/dist/mcp/tools/model-search.js +14 -0
- package/dist/mcp/tools/model-search.js.map +2 -2
- package/dist/mcp/tools/model-show.js +29 -2
- package/dist/mcp/tools/model-show.js.map +2 -2
- package/dist/mcp/tools/model-trace.js +93 -30
- package/dist/mcp/tools/model-trace.js.map +2 -2
- package/dist/mcp/tools/model-update.js +46 -26
- package/dist/mcp/tools/model-update.js.map +2 -2
- package/dist/mcp/tools/model-validate.js +46 -4
- package/dist/mcp/tools/model-validate.js.map +2 -2
- package/dist/mcp/tools/project-status-collectors.js +381 -0
- package/dist/mcp/tools/project-status-collectors.js.map +7 -0
- package/dist/mcp/tools/project-status.js +237 -0
- package/dist/mcp/tools/project-status.js.map +7 -0
- package/dist/mcp/tools/project-tools.js +505 -0
- package/dist/mcp/tools/project-tools.js.map +7 -0
- package/dist/mcp/tools/relationship-tools.js +167 -0
- package/dist/mcp/tools/relationship-tools.js.map +7 -0
- package/dist/mcp/tools/review-open.js +210 -0
- package/dist/mcp/tools/review-open.js.map +7 -0
- package/dist/mcp/tools/shared.js +35 -4
- package/dist/mcp/tools/shared.js.map +2 -2
- package/dist/mcp/tools/spec-type.js +90 -0
- package/dist/mcp/tools/spec-type.js.map +7 -0
- package/dist/reports/model-report-orchestrator.js +31 -2
- package/dist/reports/model-report-orchestrator.js.map +2 -2
- package/dist/schemas/bundled/analyzers/cbm.json +1200 -70
- package/dist/schemas/bundled/analyzers/manifest.json +2 -2
- package/dist/schemas/bundled/api.json +1029 -1658
- package/dist/schemas/bundled/apm.json +499 -734
- package/dist/schemas/bundled/application.json +735 -371
- package/dist/schemas/bundled/base.json +3 -220
- package/dist/schemas/bundled/business.json +452 -366
- package/dist/schemas/bundled/data-model.json +395 -411
- package/dist/schemas/bundled/data-store.json +334 -558
- package/dist/schemas/bundled/manifest.json +18 -18
- package/dist/schemas/bundled/motivation.json +349 -368
- package/dist/schemas/bundled/navigation.json +415 -731
- package/dist/schemas/bundled/product.json +325 -159
- package/dist/schemas/bundled/security.json +864 -1232
- package/dist/schemas/bundled/technology.json +574 -703
- package/dist/schemas/bundled/testing.json +865 -1646
- package/dist/schemas/bundled/ux.json +739 -1352
- package/dist/server/schemas.js +8 -0
- package/dist/server/schemas.js.map +2 -2
- package/dist/server/server.js +686 -231
- package/dist/server/server.js.map +3 -3
- package/dist/server/viewer-registry.js +264 -0
- package/dist/server/viewer-registry.js.map +7 -0
- package/dist/server-entry.js +2 -1
- package/dist/server-entry.js.map +2 -2
- package/dist/telemetry/index.js +1 -1
- package/dist/utils/ansi-suppressor.js +6 -8
- package/dist/utils/ansi-suppressor.js.map +2 -2
- package/dist/utils/attribute-patch.js +41 -0
- package/dist/utils/attribute-patch.js.map +7 -0
- package/dist/utils/error-hints.js +29 -0
- package/dist/utils/error-hints.js.map +7 -0
- package/dist/utils/errors.js +9 -3
- package/dist/utils/errors.js.map +2 -2
- package/dist/utils/id-generator.js +5 -2
- package/dist/utils/id-generator.js.map +2 -2
- package/dist/utils/project-paths.js +26 -1
- package/dist/utils/project-paths.js.map +2 -2
- package/dist/utils/source-reference.js +64 -31
- package/dist/utils/source-reference.js.map +2 -2
- package/dist/utils/spec-version.js +2 -2
- package/dist/utils/spec-version.js.map +1 -1
- package/dist/validators/composed-reference-validator.js +5 -27
- package/dist/validators/composed-reference-validator.js.map +2 -2
- package/dist/validators/model-warnings.js +28 -0
- package/dist/validators/model-warnings.js.map +7 -0
- package/dist/validators/reference-validator.js +0 -7
- package/dist/validators/reference-validator.js.map +2 -2
- package/dist/validators/relationship-schema-validator.js +3 -3
- package/dist/validators/relationship-schema-validator.js.map +2 -2
- package/dist/validators/schema-validator.js +27 -9
- package/dist/validators/schema-validator.js.map +2 -2
- package/dist/validators/types.js.map +1 -1
- package/dist/viewer/README.md +6 -6
- package/dist/viewer/assets/main-CUOQGGRA.css +1 -0
- package/dist/viewer/assets/main-DvH3gYrI.js +84 -0
- package/dist/viewer/index.html +2 -2
- package/dist/viewer/manifest.json +10 -10
- package/dist/viewer/version.json +1 -1
- package/package.json +2 -1
- package/dist/viewer/assets/main-B7AOQXXX.js +0 -81
- package/dist/viewer/assets/main-vdrFrG7q.css +0 -1
|
@@ -143,20 +143,65 @@ Activate when the user:
|
|
|
143
143
|
|
|
144
144
|
---
|
|
145
145
|
|
|
146
|
-
##
|
|
146
|
+
## Intra-Layer Relationships
|
|
147
|
+
|
|
148
|
+
A resource aggregates the instrumentation scopes running in it, and a scope aggregates the spans,
|
|
149
|
+
metric instruments and log records emitted under it. Providers (trace, metric, log configurations)
|
|
150
|
+
depend on their resource and aggregate processors and exporters. Each signal flows through its own
|
|
151
|
+
processors to exporters; signals are correlated by `references`. Only signals and instrumentation
|
|
152
|
+
configurations `monitors` elements in other layers; alerts and dashboards monitor signals.
|
|
153
|
+
|
|
154
|
+
| Source Type | Predicate | Target Type | Example |
|
|
155
|
+
| --------------------- | ---------- | -------------------- | ---------------------------------------------------------------- |
|
|
156
|
+
| Span | composes | SpanEvent | "Process Order" composes "Payment Authorized" |
|
|
157
|
+
| Span | aggregates | SpanLink | "Process Order Batch" aggregates "Link To Enqueue Trace" |
|
|
158
|
+
| SpanLink | references | Span | "Link To Enqueue Trace" references "Enqueue Order" |
|
|
159
|
+
| Span | references | Span | "Charge Card" references "Process Order" (parent span) |
|
|
160
|
+
| Resource | aggregates | InstrumentationScope | "order-service Resource" aggregates "orders-tracer" |
|
|
161
|
+
| Span | flows-to | ExporterConfig | "Process Order" flows-to "OTLP Trace Exporter" |
|
|
162
|
+
| InstrumentationScope | aggregates | LogRecord | "orders-logger" aggregates "Payment Error Log" |
|
|
163
|
+
| MetricInstrument | flows-to | ExporterConfig | "order_rate" flows-to "Prometheus Exporter" |
|
|
164
|
+
| LogRecord | references | Span | "Payment Error Log" references "Charge Card" |
|
|
165
|
+
| LogRecord | flows-to | LogProcessor | "Payment Error Log" flows-to "PII Redaction Processor" |
|
|
166
|
+
| LogProcessor | flows-to | ExporterConfig | "PII Redaction Processor" flows-to "OTLP Log Exporter" |
|
|
167
|
+
| InstrumentationScope | aggregates | Span | "orders-tracer" aggregates "Process Order" |
|
|
168
|
+
| InstrumentationScope | aggregates | MetricInstrument | "orders-meter" aggregates "order_rate" |
|
|
169
|
+
| InstrumentationConfig | references | InstrumentationScope | "Node Auto-Instrumentation" references "express instrumentation" |
|
|
170
|
+
| TraceConfiguration | depends-on | Resource | "Order Service Tracing" depends-on "order-service Resource" |
|
|
171
|
+
| MetricConfiguration | aggregates | MetricInstrument | "Order Service Metrics" aggregates "order_rate" |
|
|
172
|
+
| LogConfiguration | aggregates | LogProcessor | "Order Service Logging" aggregates "PII Redaction Processor" |
|
|
173
|
+
| Alert | monitors | MetricInstrument | "High Order Error Rate" monitors "order_errors_total" |
|
|
174
|
+
| Dashboard | monitors | MetricInstrument | "Order Operations Dashboard" monitors "order_rate" |
|
|
175
|
+
| Dashboard | references | Alert | "Order Operations Dashboard" references "High Order Error Rate" |
|
|
147
176
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
- `instrumented-service` → Application Layer (which service is being monitored?)
|
|
151
|
-
- `business-metrics` → Business Layer (business KPIs)
|
|
152
|
-
|
|
153
|
-
**Incoming (Other Layers → APM):**
|
|
177
|
+
---
|
|
154
178
|
|
|
155
|
-
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
179
|
+
## Cross-Layer References
|
|
180
|
+
|
|
181
|
+
### Outgoing References (APM → Other Layers)
|
|
182
|
+
|
|
183
|
+
| Source Type | Predicate | Target Type | Example |
|
|
184
|
+
| --------------------- | ---------------- | ---------------------------------- | -------------------------------------------------------------- |
|
|
185
|
+
| Span | monitors | `application.applicationservice` | "Process Order" monitors "Order Service" |
|
|
186
|
+
| Span | monitors | `api.operation` | "POST /orders" span monitors "Create Order" |
|
|
187
|
+
| Span | monitors | `navigation.route` | "Route Change" monitors "Checkout Route" |
|
|
188
|
+
| Span | monitors | `data-store.collection` | "Insert Order" monitors "orders table" |
|
|
189
|
+
| MetricInstrument | monitors | `api.operation` | "http_server_duration" monitors "Create Order" |
|
|
190
|
+
| MetricInstrument | monitors | `business.businessprocess` | "order_rate" monitors "Order Fulfillment" |
|
|
191
|
+
| MetricInstrument | monitors | `data-store.database` | "db_pool_connections" monitors "Orders Database" |
|
|
192
|
+
| MetricInstrument | measures-outcome | `motivation.outcome` | "order_rate" measures "Higher Order Throughput" |
|
|
193
|
+
| MetricInstrument | satisfies | `motivation.requirement` | "http_server_duration" satisfies "p95 Latency Under 300ms" |
|
|
194
|
+
| Resource | maps-to | `application.applicationcomponent` | "order-service Resource" maps-to "Order Service Component" |
|
|
195
|
+
| Resource | references | `technology.node` | "order-service Resource" references "EKS Production Cluster" |
|
|
196
|
+
| InstrumentationConfig | monitors | `application.applicationcomponent` | "Node Auto-Instrumentation" monitors "Order Service Component" |
|
|
197
|
+
| LogConfiguration | satisfies | `security.auditconfig` | "Order Service Logging" satisfies "Order Audit Logging" |
|
|
198
|
+
|
|
199
|
+
### Incoming References (Other Layers → APM)
|
|
200
|
+
|
|
201
|
+
| Source Type | Predicate | Target Type | Example |
|
|
202
|
+
| -------------------------------- | ---------- | ------------------ | -------------------------------------------------- |
|
|
203
|
+
| `application.applicationservice` | references | TraceConfiguration | "Order Service" references "Order Service Tracing" |
|
|
204
|
+
| `testing.testcasesketch` | tests | MetricInstrument | "Order Counter Increments" tests "order_rate" |
|
|
160
205
|
|
|
161
206
|
---
|
|
162
207
|
|
|
@@ -139,22 +139,88 @@ Activate when the user:
|
|
|
139
139
|
|
|
140
140
|
---
|
|
141
141
|
|
|
142
|
-
##
|
|
142
|
+
## Intra-Layer Relationships
|
|
143
|
+
|
|
144
|
+
Each testing type has one composing parent. The model composes targets, partitions, context
|
|
145
|
+
variations, environment factors, exclusions and the summary; a target composes its input fields,
|
|
146
|
+
outcome categories, coverage requirements and test case sketches. A sketch `validates` the one
|
|
147
|
+
requirement it exercises and `references` its context variation and outcome category. Only target
|
|
148
|
+
input fields reference the field under test, so partitions stay reusable. Summaries report with
|
|
149
|
+
`references` and `aggregates`; they never `validates`.
|
|
150
|
+
|
|
151
|
+
| Source Type | Predicate | Target Type | Example |
|
|
152
|
+
| ----------------------- | ---------- | ----------------------- | ------------------------------------------------------------------------- |
|
|
153
|
+
| TestCoverageModel | composes | TestCoverageTarget | "Login API Coverage Model" composes "Login Endpoint Coverage" |
|
|
154
|
+
| TestCoverageModel | composes | ContextVariation | "Login API Coverage Model" composes "Security Testing" |
|
|
155
|
+
| TestCoverageModel | composes | EnvironmentFactor | "Login API Coverage Model" composes "Rate Limiter Enabled" |
|
|
156
|
+
| TestCoverageModel | composes | InputSpacePartition | "Login API Coverage Model" composes "Email Format Partition" |
|
|
157
|
+
| TestCoverageModel | composes | CoverageExclusion | "Login API Coverage Model" composes "SSO Login Out Of Scope" |
|
|
158
|
+
| TestCoverageModel | composes | CoverageSummary | "Login API Coverage Model" composes "Login Coverage Summary" |
|
|
159
|
+
| TestCoverageTarget | composes | TargetInputField | "Login Endpoint Coverage" composes "email field" |
|
|
160
|
+
| TestCoverageTarget | composes | OutcomeCategory | "Login Endpoint Coverage" composes "Invalid Credentials (401)" |
|
|
161
|
+
| TestCoverageTarget | composes | CoverageRequirement | "Login Endpoint Coverage" composes "Pairwise Credentials" |
|
|
162
|
+
| TestCoverageTarget | composes | TestCaseSketch | "Login Endpoint Coverage" composes "Valid Login Test Case" |
|
|
163
|
+
| TargetInputField | references | InputSpacePartition | "email field" references "Email Format Partition" |
|
|
164
|
+
| InputSpacePartition | composes | PartitionValue | "Email Format Partition" composes "Malformed Email" |
|
|
165
|
+
| PartitionDependency | references | PartitionValue | "Locked Account Requires Valid Email" references "Locked Account" |
|
|
166
|
+
| PartitionDependency | references | InputSpacePartition | "Locked Account Requires Valid Email" references "Email Format Partition" |
|
|
167
|
+
| CoverageRequirement | composes | InputPartitionSelection | "Pairwise Credentials" composes "Email x Password Selection" |
|
|
168
|
+
| CoverageRequirement | references | OutcomeCategory | "Pairwise Credentials" references "Invalid Credentials (401)" |
|
|
169
|
+
| CoverageRequirement | references | ContextVariation | "Pairwise Credentials" references "Security Testing" |
|
|
170
|
+
| InputPartitionSelection | references | PartitionValue | "Email x Password Selection" references "Malformed Email" |
|
|
171
|
+
| TestCaseSketch | validates | CoverageRequirement | "Valid Login Test Case" validates "Pairwise Credentials" |
|
|
172
|
+
| TestCaseSketch | composes | InputSelection | "Valid Login Test Case" composes "Valid Email + Valid Password" |
|
|
173
|
+
| InputSelection | references | PartitionValue | "Valid Email + Valid Password" references "Well-Formed Email" |
|
|
174
|
+
| TestCaseSketch | references | OutcomeCategory | "Valid Login Test Case" references "Success (200 + JWT)" |
|
|
175
|
+
| TestCaseSketch | references | ContextVariation | "Brute Force Lockout Test" references "Security Testing" |
|
|
176
|
+
| ContextVariation | references | EnvironmentFactor | "Security Testing" references "Rate Limiter Enabled" |
|
|
177
|
+
| CoverageGap | references | CoverageRequirement | "No MFA Cases" references "Pairwise Credentials" |
|
|
178
|
+
| CoverageExclusion | references | TestCoverageTarget | "SSO Login Out Of Scope" references "Login Endpoint Coverage" |
|
|
179
|
+
| CoverageExclusion | references | CoverageGap | "SSO Login Out Of Scope" references "No SSO Cases" |
|
|
180
|
+
| TargetCoverageSummary | references | TestCoverageTarget | "Login Endpoint Rollup" references "Login Endpoint Coverage" |
|
|
181
|
+
| TargetCoverageSummary | references | CoverageGap | "Login Endpoint Rollup" references "No MFA Cases" |
|
|
182
|
+
| CoverageSummary | aggregates | TargetCoverageSummary | "Login Coverage Summary" aggregates "Login Endpoint Rollup" |
|
|
143
183
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
- `motivation.supports-goals` → Motivation Layer (quality goals)
|
|
147
|
-
- `motivation.fulfills-requirements` → Motivation Layer (test requirements)
|
|
148
|
-
- `business.covers-process` → Business Layer (process coverage)
|
|
149
|
-
- `api.tests-operation` → API Layer (API endpoint testing)
|
|
150
|
-
- `data.validates-schema` → Data Model Layer (data validation)
|
|
151
|
-
- `ux.tests-view` → UX Layer (UI testing)
|
|
152
|
-
|
|
153
|
-
**Incoming (Other Layers → Testing):**
|
|
184
|
+
---
|
|
154
185
|
|
|
155
|
-
-
|
|
156
|
-
|
|
157
|
-
|
|
186
|
+
## Cross-Layer References
|
|
187
|
+
|
|
188
|
+
### Outgoing References (Testing → Other Layers)
|
|
189
|
+
|
|
190
|
+
A target `covers` the production artifact it names; a sketch `tests` what it exercises. The model
|
|
191
|
+
covers only the application component, UX application or API document it is for. Requirements and
|
|
192
|
+
summaries reach no other layer. Only the model and test case sketches link to motivation.
|
|
193
|
+
|
|
194
|
+
| Source Type | Predicate | Target Type | Example |
|
|
195
|
+
| ------------------ | ---------------- | ---------------------------------- | --------------------------------------------------------------------- |
|
|
196
|
+
| TestCoverageModel | covers | `application.applicationcomponent` | "Login API Coverage Model" covers "Auth Service" |
|
|
197
|
+
| TestCoverageModel | covers | `api.openapidocument` | "Login API Coverage Model" covers "Auth API" |
|
|
198
|
+
| TestCoverageModel | supports | `motivation.goal` | "Login API Coverage Model" supports "Secure Customer Access" |
|
|
199
|
+
| TestCoverageModel | satisfies | `motivation.requirement` | "Login API Coverage Model" satisfies "Auth Must Be Regression Tested" |
|
|
200
|
+
| TestCoverageModel | measures-outcome | `motivation.outcome` | "Login API Coverage Model" measures-outcome "Fewer Auth Incidents" |
|
|
201
|
+
| TestCoverageTarget | covers | `api.operation` | "Login Endpoint Coverage" covers "POST /auth/login" |
|
|
202
|
+
| TestCoverageTarget | covers | `product.feature` | "Password Reset Coverage" covers "Self-Service Password Reset" |
|
|
203
|
+
| TestCoverageTarget | covers | `ux.view` | "Login Screen Coverage" covers "Login View" |
|
|
204
|
+
| TestCoverageTarget | covers | `data-store.storedlogic` | "Order Total Trigger Coverage" covers "recalc_order_total" |
|
|
205
|
+
| TestCaseSketch | tests | `api.operation` | "Valid Login Test Case" tests "POST /auth/login" |
|
|
206
|
+
| TestCaseSketch | tests | `api.response` | "Invalid Password Test" tests "401 Unauthorized" |
|
|
207
|
+
| TestCaseSketch | tests | `business.businessprocess` | "Complete Checkout E2E" tests "Order Checkout" |
|
|
208
|
+
| TestCaseSketch | tests | `ux.view` | "Login Form Renders Errors" tests "Login View" |
|
|
209
|
+
| TestCaseSketch | tests | `navigation.route` | "Deep Link To Profile" tests "User Profile Route" |
|
|
210
|
+
| TestCaseSketch | tests | `security.threat` | "Brute Force Lockout Test" tests "Credential Stuffing" |
|
|
211
|
+
| TestCaseSketch | tests | `data-model.schemadefinition` | "Reject Unknown Order Fields" tests "Order Schema" |
|
|
212
|
+
| TestCaseSketch | tests | `data-model.objectschema` | "Order Total Is Never Negative" tests "Order" |
|
|
213
|
+
| TestCaseSketch | tests | `data-store.accesspattern` | "Find Owners By Last Name" tests "findByLastName" |
|
|
214
|
+
| TestCaseSketch | tests | `application.applicationcomponent` | "Pet Type Formatter Parses Names" tests "PetTypeFormatter" |
|
|
215
|
+
| TestCaseSketch | satisfies | `motivation.requirement` | "Brute Force Lockout Test" satisfies "Lock After 5 Failures" |
|
|
216
|
+
| TestCaseSketch | accesses | `data-store.collection` | "Order History Test" accesses `orders` |
|
|
217
|
+
| TargetInputField | references | `api.parameter` | "email field" references "email parameter" |
|
|
218
|
+
| TargetInputField | references | `data-model.schemaproperty` | "email field" references "User.email" |
|
|
219
|
+
| EnvironmentFactor | references | `technology.systemsoftware` | "PostgreSQL 16" references "PostgreSQL" |
|
|
220
|
+
|
|
221
|
+
### Incoming References (Other Layers → Testing)
|
|
222
|
+
|
|
223
|
+
None. Testing is a leaf layer: other layers do not hold relationships pointing into it. Record traceability from the testing side (e.g. `TestCaseSketch tests api.operation`).
|
|
158
224
|
|
|
159
225
|
---
|
|
160
226
|
|
|
@@ -202,10 +268,13 @@ name: "Login API Coverage Model"
|
|
|
202
268
|
type: testcoveragemodel
|
|
203
269
|
properties:
|
|
204
270
|
version: "1.0"
|
|
205
|
-
application: application.service.auth-service
|
|
206
271
|
description: "ISP coverage model for the Login API"
|
|
207
272
|
```
|
|
208
273
|
|
|
274
|
+
```bash
|
|
275
|
+
dr relationship add testing.testcoveragemodel.login-api application.applicationcomponent.auth-service --predicate covers
|
|
276
|
+
```
|
|
277
|
+
|
|
209
278
|
---
|
|
210
279
|
|
|
211
280
|
## Example: Login Test Coverage Target
|
|
@@ -220,6 +289,11 @@ properties:
|
|
|
220
289
|
priority: critical
|
|
221
290
|
```
|
|
222
291
|
|
|
292
|
+
```bash
|
|
293
|
+
dr relationship add testing.testcoveragemodel.login-api testing.testcoveragetarget.login-endpoint --predicate composes
|
|
294
|
+
dr relationship add testing.testcoveragetarget.login-endpoint api.operation.login --predicate covers
|
|
295
|
+
```
|
|
296
|
+
|
|
223
297
|
---
|
|
224
298
|
|
|
225
299
|
## Example: Test Case Sketch
|
|
@@ -234,6 +308,12 @@ properties:
|
|
|
234
308
|
implementationFormat: automated
|
|
235
309
|
```
|
|
236
310
|
|
|
311
|
+
```bash
|
|
312
|
+
dr relationship add testing.testcoveragetarget.login-endpoint testing.testcasesketch.valid-login --predicate composes
|
|
313
|
+
dr relationship add testing.testcasesketch.valid-login testing.coveragerequirement.pairwise-credentials --predicate validates
|
|
314
|
+
dr relationship add testing.testcasesketch.valid-login api.operation.login --predicate tests
|
|
315
|
+
```
|
|
316
|
+
|
|
237
317
|
---
|
|
238
318
|
|
|
239
319
|
## Coverage Completeness Checklist
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dr_change_planning
|
|
3
|
+
description: Plan a code change as a staged DR changeset through the dr MCP server, pressure-test it against the model, build from its brief, and verify the build against it. Use when asked to plan, design or scope a change in a project with a DR model.
|
|
4
|
+
triggers:
|
|
5
|
+
[
|
|
6
|
+
"plan this change",
|
|
7
|
+
"plan the change",
|
|
8
|
+
"plan a change",
|
|
9
|
+
"plan this feature",
|
|
10
|
+
"how should we build",
|
|
11
|
+
"scope this change",
|
|
12
|
+
"design this change",
|
|
13
|
+
"draft a changeset",
|
|
14
|
+
"changeset brief"
|
|
15
|
+
]
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Plan a change as a DR changeset
|
|
19
|
+
|
|
20
|
+
In a project with a DR model (`documentation-robotics/model/`), a plan is a staged changeset, not a
|
|
21
|
+
prose document. The changeset says what the change will build. The model says what is built. The
|
|
22
|
+
graph checks the plan for you. The full design is `docs/CHANGE_MODELING.md` in the DR repository.
|
|
23
|
+
|
|
24
|
+
## Before you start
|
|
25
|
+
|
|
26
|
+
- You need the `dr` MCP server. Its tools show up as `mcp__plugin_dr_dr__<tool>` from the `dr`
|
|
27
|
+
plugin, or `mcp__dr__<tool>` when the server is registered by hand as `dr`. If they are missing,
|
|
28
|
+
tell the user to install the `dr` plugin (see `integrations/claude_code/docs/MCP_SERVER.md`)
|
|
29
|
+
and stop. Don't fall back to prose.
|
|
30
|
+
- Staging writes files under `documentation-robotics/changesets/`. If the session is in plan mode,
|
|
31
|
+
say that the plan will be a changeset and leave plan mode before staging.
|
|
32
|
+
- If the project has no model yet, propose a name and confirm it with the human before
|
|
33
|
+
`project_init`. Then ask whether to bootstrap the model from the code now or let it grow with
|
|
34
|
+
each change, and wait for their answer.
|
|
35
|
+
- When `codebase_extract` returns cards (in a bootstrap, or when you verify), ask the developer about
|
|
36
|
+
the ones you can't place with confidence: whether a card is a model element at all, which type it
|
|
37
|
+
is, or whether to reject it. Don't guess. Collect them and ask once, in one short list (the card,
|
|
38
|
+
your best guess, the question), then stage or reject from the answers.
|
|
39
|
+
- You never land or discard the plan on your own. Commit it (`changeset_commit`) only when the
|
|
40
|
+
human asks you to land it; they confirm it in a dialog. Apply is not an MCP tool. Discard only when
|
|
41
|
+
they agree.
|
|
42
|
+
|
|
43
|
+
## The loop
|
|
44
|
+
|
|
45
|
+
1. **Frame.** `changeset_list` first: if a changeset for this change exists, `changeset_activate` it
|
|
46
|
+
and continue. Otherwise propose a short kebab-case `name` and a `description` that states the
|
|
47
|
+
intent (what the change is for and what done looks like), and confirm both with the human before
|
|
48
|
+
you call `changeset_create` with them. Wait for their answer. Find the goal,
|
|
49
|
+
requirement or feature it serves (`model_search` in motivation, business, product). If there is
|
|
50
|
+
none, stage one, or ask the human what the change is for.
|
|
51
|
+
2. **Orient.** `model_search` / `model_show` / `model_trace` for the elements the change touches.
|
|
52
|
+
Inside a changeset these read the plan as it stands (each result carries a change status).
|
|
53
|
+
`spec_type` for a type you will add: its required attributes, enums, and the relationships the
|
|
54
|
+
catalog allows to and from it. Within reason, every connection the spec models for a type is
|
|
55
|
+
expected, though not every one will exist: treat the catalog's list as the checklist for each
|
|
56
|
+
element the change adds or alters.
|
|
57
|
+
3. **Draft.** Stage the change in every layer it reaches: `model_add`, `model_update`,
|
|
58
|
+
`model_delete`, `relationship_add`, `relationship_delete`. Relationships may join elements that
|
|
59
|
+
exist only in the changeset. When you wire several, use the lists: `model_add` with
|
|
60
|
+
`elements: [...]` (plus `relationships` that may name elements added in the same call), and
|
|
61
|
+
`relationship_add` with `relationships: [{source, predicate, target, properties?}]`. Each list is
|
|
62
|
+
staged in one write; an invalid item is skipped and reported, so read the per-item results. For
|
|
63
|
+
a planned element with no code yet, send no source fields. Pass `sourceFile` and `sourceSymbol`
|
|
64
|
+
(with `sourceProvenance: "manual"`) only when you know where the code goes.
|
|
65
|
+
Change one attribute with `model_update` `attributePatch`, not by repeating every attribute. Fix a
|
|
66
|
+
mistake with `changeset_unstage` (one element, one relationship, or `source` or `target` alone for
|
|
67
|
+
every staged connection at that end), not by staging the reverse. To drop several, send them as
|
|
68
|
+
`changes: [...]`: one call, one write, a result per item.
|
|
69
|
+
4. **Pressure-test.** `changeset_brief`, then `changeset_impact` for anything the brief questions.
|
|
70
|
+
The brief is compact by default; pass `detail: "full"` only when you need every section in full.
|
|
71
|
+
Steps 3 and 4 are a loop: a plan comes into focus over many passes. Each pass, stage a little,
|
|
72
|
+
then:
|
|
73
|
+
- Pass the last brief's `revisionToken` as `since`; read the `delta` first. It covers unstages
|
|
74
|
+
too (`unstaged`). If it warns (a hand-edited `changes.yaml`, or a reach back past the last 200
|
|
75
|
+
unstages), read the brief itself.
|
|
76
|
+
- Work through `unwired` for each element you added or changed. The default brief only counts
|
|
77
|
+
it per layer, and `sections` returns only the sections it names, so list the entries with
|
|
78
|
+
`sections: ["unwired"], unwiredLayers: [<the layers the change reaches>]`, narrowed further with
|
|
79
|
+
`layers` or `ids` if you like. Always pass a filter: unfiltered it runs to hundreds of KB on a
|
|
80
|
+
large model. Where `existingCount` is above 0, link an existing element; otherwise decide
|
|
81
|
+
whether the change needs a new one.
|
|
82
|
+
- Walk `changeset_impact` with `from` set to what you just added, not the whole changeset.
|
|
83
|
+
- Read the plan with `changeset_show` `detail: "summary"`, not the full snapshots.
|
|
84
|
+
|
|
85
|
+
Read the brief's gaps:
|
|
86
|
+
- `peer-pattern`: most elements like this one have a connection it lacks.
|
|
87
|
+
- `unconnected`: an added element with no relationships.
|
|
88
|
+
- Intent: a change that reaches no motivation, business or product element.
|
|
89
|
+
- Layers not reached: a new API operation with nothing in data model, testing or APM is a small
|
|
90
|
+
change or an unfinished plan. Decide which.
|
|
91
|
+
- Connections the brief can't flag: for each changed element, compare what `spec_type` says its
|
|
92
|
+
type can connect to with what the plan has. Stage the ones the change needs; leave the ones it
|
|
93
|
+
doesn't, but don't skip the comparison.
|
|
94
|
+
|
|
95
|
+
For each gap, either stage what is missing or accept it. Record an accepted gap where the human
|
|
96
|
+
will see it: an `annotation_create` on the element, or a line in the description
|
|
97
|
+
(`changeset_update`). `model_validate` should pass on the projected model.
|
|
98
|
+
|
|
99
|
+
5. **Review.** Stop and show the human the brief: changes by layer, gaps fixed and gaps accepted,
|
|
100
|
+
impact, code touched. Call `review_open` and give them its `url`: it opens the plan on the graph
|
|
101
|
+
in the viewer, reusing the viewer already running for the project or starting one. The human
|
|
102
|
+
comments on elements there, including ones the plan adds. Read their comments with
|
|
103
|
+
`annotation_list`, answer with `annotation_reply`, revise, and run the brief again. Don't start building until they agree.
|
|
104
|
+
6. **Build.** Build from the brief. At the start of the build, read it with
|
|
105
|
+
`sections: ["changes"]`: each changed element's attributes and changed fields, and its
|
|
106
|
+
connections as `predicate → id` lines. For a large plan, read one layer at a time with
|
|
107
|
+
`sections: ["changes"], layers: ["<layer>"]`, taking the layers from the default brief's
|
|
108
|
+
`byLayer`. The default brief's "code touched" list is what you will edit or must not
|
|
109
|
+
break. Keep the changeset staged and commit only the plan's own directory
|
|
110
|
+
(`documentation-robotics/changesets/<id>/`, with the id `changeset_show` reports) on the branch
|
|
111
|
+
with the code. Don't add the whole `changesets/` directory: the `.active` marker and any
|
|
112
|
+
`<name>-as-built` changeset stay out of the commit. If the build has to differ from the plan,
|
|
113
|
+
change the plan to match and say why. Don't verify during the build: no `codebase_extract`, no
|
|
114
|
+
as-built changeset and no `changeset_verify` until the build is committed. Verify is the next
|
|
115
|
+
step, on its own.
|
|
116
|
+
7. **Verify.** Verify as its own step, after the build (the code and the plan's directory) is
|
|
117
|
+
committed, not in the turn that builds it. Extract what was built, separately from the plan. The
|
|
118
|
+
as-built changeset comes from `codebase_extract` and the code. Never hand-write it, and never copy
|
|
119
|
+
plan elements into it: name each element after its card (the code's symbol), not after the plan's
|
|
120
|
+
element, and don't add planned elements extraction can't see (tests, intent) to make the verdict
|
|
121
|
+
match. Re-index the code once the build is committed: `codebase_index` with `wait: 30` (it re-indexes when source files changed since the last
|
|
122
|
+
index, committed or not), then `status: true` and `wait: 30` until the job is done; don't call it
|
|
123
|
+
in a quick loop. If the result reports `ignoreFile` (the `.cbmignore` it wrote so DR's own folders
|
|
124
|
+
aren't indexed), tell the developer to commit that file. Then `codebase_extract`
|
|
125
|
+
with `since` set to the branch the work started from (e.g. `main`) and
|
|
126
|
+
`changeset: "<name>-as-built"`. It stages what the rules decide in the changed files and leaves
|
|
127
|
+
`<name>-as-built` active. If it staged nothing, it makes no changeset: `changeset_create` with the
|
|
128
|
+
name it gives before you `model_add` its cards. For each card it returns that is a model element, stage it with
|
|
129
|
+
`model_add` (`sourceFile` and `sourceSymbol` from the card, `sourceProvenance: "extracted"`),
|
|
130
|
+
reading the code, not the plan, and ask the developer about the cards you can't place, in one short
|
|
131
|
+
list;
|
|
132
|
+
then call `codebase_extract` again to stage their relationships, and `model_delete` the
|
|
133
|
+
`candidateDeletes` that are really gone. Then `changeset_verify` with `planned: <name>` and
|
|
134
|
+
`against: {"changesetId": "<name>-as-built"}`. Fix each missing, unplanned or divergent item in
|
|
135
|
+
the code or in the plan. `unverifiable` items are planned parts extraction can't see (motivation,
|
|
136
|
+
re-exports, TypeScript tests), and `notes` are description-only differences: neither needs a
|
|
137
|
+
plan edit. Never edit the plan to match extracted placeholder text. A verdict of `unverifiable`
|
|
138
|
+
means the plan has nothing extraction can check; say so rather than call it a failure. Look for missing connections in the as-built too: for each element,
|
|
139
|
+
compare what the spec models for its type with what was staged, and look for evidence of each
|
|
140
|
+
absent one in the code (and the analyzer's graph, `dr analyzer callers` / `callees`). Confirm or
|
|
141
|
+
reject every `probable` match. `changeset_activate` the plan again afterwards (the extract
|
|
142
|
+
result's `previousActive`). After verify, the plan is what lands (step 8), not the as-built
|
|
143
|
+
changeset. Ask the human whether to discard the as-built changeset (`changeset_discard`,
|
|
144
|
+
`confirm: true`) or keep it as a record, and discard it only when they agree. Don't land it:
|
|
145
|
+
landing it first changes the plan's base, so the plan then needs `force`, and the plan's
|
|
146
|
+
descriptions don't apply to elements already in the base. It stays out of git: when you commit
|
|
147
|
+
fixes, add only the plan's directory again. If the as-built changes were landed anyway,
|
|
148
|
+
`against: {"base": true, "extracted": true}` compares the plan with the model, with extraction's blind spots applied.
|
|
149
|
+
8. **Land.** The PR carries the code and the staged plan, and the human commits the plan in it, not
|
|
150
|
+
the as-built changeset. When they ask you to land it, call `changeset_commit` with its name. The server asks them
|
|
151
|
+
to confirm in a dialog that shows the name, intent, counts by operation, layers and drift, and
|
|
152
|
+
commits only if they confirm; if they decline, leave it staged. If it is refused for drift, show
|
|
153
|
+
them what drifted (`changeset_brief`) and pass `force: true` only if they still want it. Then add
|
|
154
|
+
the model's changed files and the changeset's directory to the branch. If it is refused, they land
|
|
155
|
+
it in the viewer (`review_open`, then Apply on the changeset), or you call it again from an
|
|
156
|
+
interactive session. Never point them to the `dr` CLI.
|
|
157
|
+
|
|
158
|
+
## Tolerance
|
|
159
|
+
|
|
160
|
+
Tools report odd input and carry on instead of failing. Read the report each time:
|
|
161
|
+
|
|
162
|
+
- `relationship_add` reports a duplicate, or restores a relationship the plan had deleted.
|
|
163
|
+
- `changeset_unstage` reports `not-staged` when there was nothing to drop.
|
|
164
|
+
- In a changeset-only session (DrBot with `--with-changesets`), a write with no active changeset is
|
|
165
|
+
refused. Call `changeset_create` or `changeset_activate` and retry.
|
|
166
|
+
- `changeset_commit` is refused when the human declines or cancels the dialog, when the client
|
|
167
|
+
can't show one (no MCP elicitation), and in DrBot, which doesn't have it. Nothing is written; the
|
|
168
|
+
human lands it in the viewer (`review_open`, then Apply), or from an interactive session.
|
|
169
|
+
- DrBot cannot write annotations (`annotation_create` and `annotation_reply` are not among its
|
|
170
|
+
tools). There, record accepted gaps in the description with `changeset_update` and answer the
|
|
171
|
+
human's comments in the chat.
|
|
172
|
+
- DrBot has no `review_open`: it runs in the viewer, so the human already has the plan in front
|
|
173
|
+
of them. Point them to the changeset in the viewer's Changesets view instead.
|
|
174
|
+
|
|
175
|
+
## Keep it short
|
|
176
|
+
|
|
177
|
+
Model at the grain of the change. One function, one operation and one test sketch beat a
|
|
178
|
+
speculative tree. Add detail as the build firms up.
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dr_changeset_reviewer
|
|
3
|
+
description: Review a DR changeset's staged changes for naming consistency, reference validity and layer-appropriate properties, and suggest improvements before it is committed. Use when the user works with changesets or asks for a review of one.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# Changeset Reviewer Skill
|
|
2
7
|
|
|
3
8
|
When the user works with changesets or asks for review:
|
|
@@ -134,6 +139,9 @@ For each addition, check:
|
|
|
134
139
|
- [ ] Layer-appropriate properties used
|
|
135
140
|
- [ ] References point to existing elements
|
|
136
141
|
- [ ] Status is valid for the element type
|
|
142
|
+
- [ ] Connections the spec models for its type (`dr schema relationship <layer>.<type>`) are present
|
|
143
|
+
where the change needs them; within reason every modeled connection is expected, though not
|
|
144
|
+
every one will exist
|
|
137
145
|
|
|
138
146
|
For each modification, check:
|
|
139
147
|
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dr_engineering_guide
|
|
3
|
+
description: Engineering guidance grounded in the DR model, in three modes - review requirements before code is written, guide how an implementation is structured, and critique code that exists (PR or code review). Advisory only; it recommends the next DR step rather than changing the model.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# dr_engineering_guide — Engineering Guidance Skill
|
|
2
7
|
|
|
3
8
|
## Purpose
|
|
@@ -57,7 +62,7 @@ Map the proposed change to the 13-layer model:
|
|
|
57
62
|
|
|
58
63
|
**2. Layer Hierarchy Check**
|
|
59
64
|
|
|
60
|
-
-
|
|
65
|
+
- Do the proposed relationships use predicates whose direction matches their meaning (an application function `realizes` an API operation; a service `serves` a process), and do implementation elements trace to a motivation element through `realizes`, `satisfies` or `supports`?
|
|
61
66
|
- Example red flag: "A data-store change that has no corresponding data-model change"
|
|
62
67
|
- Example red flag: "An API endpoint that doesn't map to any application service"
|
|
63
68
|
|
|
@@ -44,6 +44,8 @@ Unlike specialized agents that do one thing, you understand the **full picture**
|
|
|
44
44
|
|
|
45
45
|
**Note**: The DR CLI is implemented in TypeScript and should be invoked using bash commands.
|
|
46
46
|
|
|
47
|
+
**One `dr` command per Bash call.** Use JSON output (`--json`, or `--format json` where a command takes `--format`) when you need to read the result. Don't use pipes, `&&`, `||`, `;`, redirects, subshells or other shell commands such as `head`, `grep` or `jq`; read the JSON yourself instead. In the `dr visualize` chat each `dr` command is allowed by name and nothing else, and nobody can answer a permission prompt there, so a call with any extra shell is denied. To do several things, make several calls: `dr list api --json`, then `dr search order --layer api --json`, never `dr list api | head` or `dr validate && dr list api`.
|
|
48
|
+
|
|
47
49
|
## Knowledge Base: DR Specification v0.8.1
|
|
48
50
|
|
|
49
51
|
### The 13-Layer Architecture
|
|
@@ -105,7 +107,7 @@ x-supports-goals: [motivation.goal.revenue]
|
|
|
105
107
|
|
|
106
108
|
```yaml
|
|
107
109
|
motivation:
|
|
108
|
-
supports
|
|
110
|
+
supports: [motivation.goal.revenue]
|
|
109
111
|
business:
|
|
110
112
|
realizes-services: [business.service.orders]
|
|
111
113
|
```
|