enhance: refine DDD node and edge type#7
Merged
Conversation
2a965f2 to
45ce619
Compare
…rming + CQRS Each node and edge `description` tags its sub-domain (Strategic DDD, Tactical DDD, EventStorming, CQRS) and cites the canonical source so LLMs and reviewers know which tradition each element comes from. Node types (7 → 8): adds `policy` for Vernon Process Manager / EventStorming Policy reactions. Edge types (7 → 15): - Tactical (+1): adds `enacts` (policy → command) so the `event triggers policy enacts command` chain is structural rather than implied. - Tactical (revised): `contains` narrowed to BC → aggregate; `accepts` adds query; `emits` accepts both command-source (CQRS / EventStorming reading; preferred when extracting from PRD language) and aggregate-source (Vernon IDDD structural reading); `triggers` widened to include policy with N:N cardinality; `dependsOn` narrowed to aggregate → aggregate per Vernon's "Reference Other Aggregates by Identity" rule. - Strategic (+7): Context Mapping patterns from Evans Blue Book Part IV (partnership, customerSupplier, conformist, sharedKernel, anticorruptionLayer, openHostService, publishedLanguage). Schema: - EdgeTypeDescriptor.description added (optional in Zod, required at builder time by defineOntology, matching NodeTypeDescriptor). Skills (product-agnostic, definition-only for Context Mapping): - braid-extract: canonical-edges table includes policy and both emits shapes + checklist updates; new Policy emission and Context Mapping sections (Context Mapping is ClarifyTicket-only). - braid-model: Step 3 bridge edges covers the triggers/policy/enacts chain and BC-level Context Mapping guidance; Step 1 audit table adds two new rules for command-without-performedBy and aggregate-without-events gaps (model-time soft enforcement, not validator-blocking). - shared/artifact-formats.md: fixed stale 'CONTAINS' uppercase example to lowercase 'contains'. Tests: - New packages/ontology-ddd/test/integration.test.ts (27 tests): dddOntology integration with StructuralValidator covering policy flow, all 7 Context Mapping edges (positive + negative), tactical canonical chain including both emits readings, query-emits-event rejection, description completeness. - Updated packages/sdk/test/defineOntology.test.ts fixture to include description on edges (now required at builder time). Validation philosophy: - Validators enforce graph well-formedness (type system, references, evidence) and hard-block Apply on errors. - Model audit rules enforce DDD modelling completeness (every cmd has an actor, every agg has events) and surface as new Proposals or ClarifyTickets rather than blocking. - Semantic quality stays with AI extract + HITL review. Migration: wipe workspace artifacts + Kùzu db, re-extract. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
45ce619 to
ce7e76a
Compare
- Preview header gains a `+N / ~M / -K` impact summary chip so small incremental proposals (e.g. model audit fixes adding a handful of edges) are legible without scanning the canvas for thin stroke differences. - Added edges in the canvas use a 3px stroke (was 2) so an incremental fix stands out instead of blending into the existing topology. - Node cards gain a small corner dot for every change kind (emerald for added, amber for updated, rose for removed). Previously added had no marker at all, leaving the diff vocabulary asymmetric. - Proposal preview's graph navigator stays open by default and seeds the type filter with all types instead of just defaultVisible, so the reviewer does not have to expand the panel and tick chips to see the impact. Graph tab behaviour unchanged. - Proposals and Clarify list pages auto-select the first item on mount and on status-switch so reviewers do not need an extra click to start working through a queue. Cross-tab focus sweep takes priority on Proposals so deep-links from Clarify still land correctly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tighten
containsto textbook DDD so the BoundedContext stops being a hub-and-spoke in the Graph view. The widened edge was duplicating signal already carried byaccepts/emits/constrainedBy; the canonical form (matching ReDoc and Evans / Vernon) isBoundedContext --contains--> aggregate, full stop.packages/ontology-ddd/src/DDDOntology.ts:contains.toTypesnarrowed from['aggregate','command','query','event','rule']to['aggregate'].StructuralValidator.checkEndpoints()reads the descriptor at runtime, so the new rule activates without any validator change.packages/core/skills/braid-extract/SKILL.md: new "Canonical edges to add when emitting a new node" sub-section (per-type wiring table + ClarifyTicket guidance for orphans) + completion checklist item forbidding BC → non-aggregate contains edges.packages/core/skills/braid-model/SKILL.md: audit-table row for the invalid shape + clarifying sentence in Step 2.